Discussions

XML & Web services: image transfer via web service

  1. image transfer via web service (4 messages)

    i want to use soap to transfer image from server to client,so how can i get best performance?
    thanks

    Threaded Messages (4)

  2. Possible solution[ Go to top ]

    Er. First I'd make sure you really want to transfer the image using a SOAP web service. Since you would have to encode the image you would end up having to transfer more information compared to using an HTTP GET, which is supported by all web servers.

    But if you have a good reason to transfer binary information through a SOAP web service you would need to encode it, typically you would use BASE64 encoding. You would then decode the information on the client.

    If the binary information lends itself to it you could apply compression before the encoding, however most common picture formats are already compressed (JPG, GIF) so the benefit would be marginal (for that type of content) in relation to the cost of performing the compression. And obviously all clients would need to be able to support the compression algorithm.
  3. re:Possible solution[ Go to top ]

    thanks a lot.
    the image will be in the form of GIF,and how about treating it as an soap attachment.the encoding and decoding of base64 leads to poor performance
  4. re:Possible solution[ Go to top ]

    You are right, it is advised to send binaries as soap attachements to improve performance.
  5. re:Possible solution[ Go to top ]

    Can you bind a message to a SOAP attachment in WSDL????