Binary data through SmartSOAP

2007-11-20
2013-04-08
  • Alexander Katasonov

    Hi!

    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. 

    Thanks!

     
    • andrew7

      andrew7 - 2007-11-20

      From http://www.w3.org/TR/2001/WD-soap12-20010709/

      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 [10][11], which uses the base64 encoding algorithm defined in 2045 [13]. 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.

      Example 15

      <picture xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
               xmlns:enc="http://www.w3.org/2001/06/soap-encoding"
               xsi:type="enc:base64" >
         aG93IG5vDyBicm73biBjb3cNCg==
      </picture>

      Image with base64 encoding

      I guess a reasonable extension to SmartSoap would be to do base64 encoding and decoding...

       

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks