Testing and mocking SOAP (MTOM+XOP) attachments

In this recipe, we'll look at how to mock and test SOAP attachments using SoapUI. Without going into too many details, there are several options for sending binary attachments using SOAP:

  • Inline Attachment: The attachment is encoded using Base64 and is represented as XML inside the SOAP envelope.
  • SOAP with attachments (SwA): The attachment is not encoded, and is represented separately to the SOAP envelope as binary data using a mime attachment. The attachment is then referenced from the SOAP message using href, for example, <attachment href="cid:imgID"/>.
  • Message Transmission Optimization Mechanism (MTOM) using XML-binary Optimized Packaging (XOP): Like SwA, a separate mime attachment is used to represent ...

Get SoapUI Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.