Forum Discussion

eialbur's avatar
eialbur
New Contributor
14 years ago

Need help with MTOM

First, let me apologize for being new both with Web Services and with SoapUI. I browsed thru earlier postings on MTOM, but I'm afraid that either I didn't understand them or I didn't think they applied to my situation.

I have a wsdl that includes MTOM attachments. First, I define the xmime namespace in the wsdl:definitions section, e.g.:
xmlns:xmime="http://www.w3.org/2005/05/xmlmime"
and then I declare the element to be MTOM, e.g.:
<xsd:element name="foo" type="xsd:base64Binary" xmime:expectedContentTypes="application/octet-stream"/>

I am doing Soap 1.2 top-down Web Service development. The generated code does create a DataHandler as expected, and does annotate the parameter with @XmlMimeType("application/octet-stream") as expected.

When I use SoapUI to send the message I attach a file (being careful to set the 'Part' column). It successfully sends the message to the server, and the server does successfully understand the message, and the DataHandler does report itself to be octet-stream. But when I look at the html log I see the file attachment is inline with base64 encoding.

If I set the "Enable MTOM" Request Property true, then SoapUI does send the file as an attachment but I get a Receiver SOAP exception saying a data handler was not found for the content.

If I validate the WSDL with other tools it passes, but the SoapUI report says: Fatal error: The prefix "xmime" for attribute "xmime:expectedContentTypes" associated with an element type "xsd:element" is not bound - which I really don't understand as I did declare the xmime namespace.

Any assistance would be greatly appreciated.

Thanks,
Ron
  • eialbur's avatar
    eialbur
    New Contributor
    I believe I have found the problem.

    When I created the attachment I didn't go back to update the Request xml and change the 'cid' value. When I set the cid to the content ID of the attachment then things seem to work correctly.