Binary Data
When using data services, users come across the need to transfer binary data from/to the server. This is handled in WSO2 Data Services Server using Base64 encoding. When sending, binary data should be encoded in Base64 format. Similarly, when receiving, the receiving character data must be Base64-decoded in oder to retrieve the original binary data back.
Binary data type is available as an SQL Type when creating Input Mappings for your queries, which are defined while creating data services. For example,
When defining the result of a data service, in order to declare that a binary value is expected, you have to add a suitable entry in Output Mappings. The Schema Type of the Output Mapping should be selected as "xs:base64Binary." For example,
When using code-generated clients, the encoding/decoding of Base64 data need not be explicitly done by the user since the existence of binary data is mentioned in the WSDL. For example, in Axis2 code-generated stubs, the binary types are handled using the DataHandler class.