Keep your binary clean with MTOM XOP

SOAP is an XML-based protocol, which means that all data inside the SOAP envelope must be text-based. If you want to include binary data in a SOAP message, it too must be text-based. To achieve this, you can convert binary data to a base64 encoded string and simply embed the string inside the SOAP message. The diagram below shows a sample SOAP message with binary data embedded as a base64 string.

Sending Binary Data with SOAP Without MTOM

While this is a simple approach for dealing with binary data with SOAP, there are a few things to consider. When binary data is base64 encoded, it increases in size by approximately 30%. For small amounts of binary data, this probably won’t be an issue, but for larger volumes of data, the increased message size can significantly impact performance.

Keep your binary clean with MTOM XOP

SOAP is an XML-based protocol, which means that all data inside the SOAP envelope must be text-based. If you want to include binary data in a SOAP message, it too must be text-based. To achieve this, you can convert binary data to a base64 encoded string and simply embed the string inside the SOAP message. The diagram below shows a sample SOAP message with binary data embedded as a base64 string.

Sending Binary Data with SOAP Without MTOM

While this is a simple approach for dealing with binary data with SOAP, there are a few things to consider. When binary data is base64 encoded, it increases in size by approximately 30%. For small amounts of binary data, this probably won’t be an issue, but for larger volumes of data, the increased message size can significantly impact performance. […]