Forum: Ruby on Rails File transfer via SOAP

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9aedca736ea2277b591ee4962658caea?d=identicon&s=25 "Евгений Куртов" <me@lessless.pp.ua> (Guest)
on 2013-08-05 15:42
(Received via mailing list)
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.
280b78a61a968391b7e07e912be102a8?d=identicon&s=25 Robert Walker (robert4723)
on 2013-08-06 03:05
"Евгений Куртов" <me@lessless.pp.ua> wrote in post #1117771:
> 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.

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.
This topic is locked and can not be replied to.