Tag Archives: binary data

Attachments with SOAP

Just read an article on how to send (binary) attachments with SOAP.

One described approach is to include the data as MIME or Base64 encoded CDATA blocks. Another possibility is to attach the binary data outside the SOAP message (like it is done in emails). Finally the author talks about SOAP Message Transmission Optimization Mechanism (MTOM), which is supposed to fix the problem.

Well, MTOM has to be understood by the server and the client, which means we have to find a proper implementation etc. Why all this hassle? If it is necessary to send such data, it would perhaps make sense to think of using a Resource-Oriented Architecture (ROA) like RESTful Web Services. This doesn’t mean that it is necessary to switch over completely from a SOA to a ROA, but both techniques could complement each other in RPC-heavy systems. In other cases I would try to avoid using SOAP and focus on resources instead.