webservices: Add support for writing attributes and text in binary mode.