I am trying to use SmartSOAP to communicate with my Web Service. It is really nice library, but I have a problem to send binary data through it. XMLNode has method addChild() and its parameters have tstring type, so that makes impossible to put binary array there, because of special simbols like "\0". I reviewed HTTPRequest class but it requires tstring parameters as well. Help me please to find out the right way to send binary data. I see only one solution for present time and it's rewriting of SmartSOAP code to get text stream from HTTPRequest object and push binary data to there.
5.2.3 Array of Bytes
An array of bytes MAY be encoded as a single-reference or a multi-reference value. The rules for an array of bytes are similar to those for a string.
In particular, the containing element of the array of bytes value MAY have an "id" attribute. Additional accessor elements MAY then have matching "href" attributes.
The recommended representation of an opaque array of bytes is the 'base64' encoding defined in XML Schemas , which uses the base64 encoding algorithm defined in 2045 . However, the line length restrictions that normally apply to base64 data in MIME do not apply in SOAP. A "enc:base64" subtype is supplied for use with SOAP.
Image with base64 encoding
I guess a reasonable extension to SmartSoap would be to do base64 encoding and decoding...
Log in to post a comment.