how do I test an MTOM webservice with soapUI?

21,143

Solution 1

Here is what worked for me:

  • First, set your request properties to enable MTOM

enter image description here

  • Then, when you get response, open attachments tab and click tiny button (see picture) to export attachment

enter image description here

Solution 2

Is the binaryData content returned with MTOM packaging, or is the binary data just inlined in the message? (you can see this in the raw response viewer in soapUI)

If it is an attachment you should have a corresponding attachment in the response attachments tab at the bottom of the response window.

If this doesn't help please raise an issue at the soapUI forum at eviware.com and attach a screenshot of the raw response message..

regards!

/Ole eviware.com

Share:
21,143
mecabpazzo95
Author by

mecabpazzo95

I'm a software engineer interested in functional programing, linguistics, mobile software, and the game of Go. (in no particular order)

Updated on November 29, 2020

Comments

  • mecabpazzo95
    mecabpazzo95 over 3 years

    I've built a webservice that wraps Apache FOP. You send it XML, and it gives you an MTOM stream that contains the rendered PDF. Now that its working, I'd like to run some performance tests on it. soapUI says they support MTOM, and I use it for all my other webservice performance testing, so it would be great if I didn't have to write a custom test harness.

    So here's the issue: I get the response back in soapUI, and it looks like this:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Body>
          <ns2:RenderDocumentResponse xmlns:ns2="http://webservices.cscinfo.com/renderService">
             <ns2:Content>
                <ns2:fileName xsi:nil="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
                <ns2:fileType>pdf</ns2:fileType>
                <ns2:mimeType>application/pdf</ns2:mimeType>
        <ns2:binaryData>JVBERAkAAiNkRUcERRkaYIMijggKNDkbEiioUBUbHrBBlE1HFwFBuWSWStGd+8ee/Nm98f935rn73P3Wfvfda6AJD8gwXCTFgJgAyhWBTh58WIjYtnYAcBDPAAA2wA4HCzs0IW+EYCmQJ82IxsmRP4F726DiD5+yrTP4zBAP+flLlZIjEAUJiM5/L42VwZF8k4PVecJbdPyZi2NE3OMErOIlmCMlaTc</ns2:binaryData>
             </ns2:Content>
             <ns2:message>file rendered</ns2:message>
          </ns2:RenderDocumentResponse>
       </soapenv:Body>
    </soapenv:Envelope>
    

    How do I get soapUI to dump and decode the binary data for me? I want to make sure its a valid PDF and all that. (I've truncated the data in the response for brevity, and munged it to protect the guilty! So its not real PDF data in this post)

    Update: here's what soapUI shows in the "raw" response tab:

    HTTP/1.1 200 OK
    Date: Wed, 13 Jan 2010 17:02:31 GMT
    Transfer-Encoding: chunked
    Content-Type: text/xml; charset=UTF-8
    X-Powered-By: Servlet/2.5 JSP/2.1
    
  • John Saunders
    John Saunders over 14 years
    Thanks for the response. If you're from eviware, then why not get a "real" account? There are quite a few soapUI questions you could answer (and I'd ask a few myself if I thought there were eviware folks on this site).
  • mecabpazzo95
    mecabpazzo95 over 14 years
    There is no attachment - the data is inlined in the response as shown.
  • mecabpazzo95
    mecabpazzo95 over 14 years
    I posted in the eviware forums too. eviware.com/forums/index.php?topic=3050.0