File transfer via SOAP

31 views
Skip to first unread message

Евгений Куртов

unread,
Aug 5, 2013, 9:41:22 AM8/5/13
to rubyonra...@googlegroups.com
Hello! Can't find any related data on the subject: how to receive a file via SOAP. If anyone have accomplished such a task I'll be very greatful for any help and info.
Thanks.

Robert Walker

unread,
Aug 5, 2013, 9:05:27 PM8/5/13
to rubyonra...@googlegroups.com
"Евгений Куртов" <m...@lessless.pp.ua> wrote in post #1117771:
SOAP is actually not a great transport layer for large files. SOAP is an
XML based protocol, which essentially is just a structured text file.

If you really must use SOAP to transfer large files then you'll need to
use something like Base64 encoding and embed the file in an XML tag.

Here's a basic example:
<soap:Envelope
xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Body>
<submitClaim>
<accountNumber>5XJ45-3B2</accountNumber>
<eventType>accident</eventType>
<image imageType="jpg" xsi:type="base64binary">
4f3e9b0...(rest of encoded image)
</image>
</submitClaim>
</soap:Body>
</soap:Envelope>

Notice the xsi:type="base64binary". In this example they are encoding
the JPEG binary data as base64 ASCII text.

--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages