Menu

#669 SoapUI can't find the attachment using the xop:Include href

v1.0 (example)
open
nobody
None
6
2015-07-27
2014-11-17
No

SoapUI 5.0.0, JRE 1.7.0_40 32 bit Win7 64.

"Expand MTOM Attachments" option doesn't work anymore with CXF 2.6.16 and 2.7.X (works with 2.6.9). The only substantial difference that I see it that with the fresh CXF versions the CID happens to contain characters that will be URL-encoded (%XX). Like now in the SOAP response we have:

<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:4448f26f-b153-4fac-9fca-9e368707c34d-4@http%3A%2F%2Fexample.com%2Fkr%2Ffoo%2Fapi%2F1.0"/>

and then the attachment part starts with:

Content-ID: 4448f26f-b153-4fac-9fca-9e368707c34d-1@http://example.com/kr/foo/api/1.0

The two CID-s aren't equal if you don't URL-decode the XOP href before comparison, and apparently do don't. Note that it's NOT a CXF bug, it's a SoapUI bug.

The relevant standards were discussed there:
http://cxf.547215.n5.nabble.com/MTOM-producer-different-content-id-in-XOP-Include-and-MIME-part-for-the-same-attachment-td547750.html

Discussion

  • Dániel Dékány

    That is, in WsdlMimeMessageResponse.java, around line 120, instead of this:

    Attachment attachment = getMmSupport().getAttachmentWithContentId("<" + href.substring(4) + ">");
    

    you need this:

    Attachment attachment = getMmSupport().getAttachmentWithContentId("<" + URLDecoder.decode(href.substring(4), "UTF-8") + ">");
    

    And maybe also on a few places in AttachmentUtils.java, because you also read the xop:Include/@href attribute there.

     
  • Dániel Dékány

    I have updated to 5.2.0, and this is still not fixed. The same fix applies...

     

Log in to post a comment.