Forum Discussion

Ooblioob's avatar
Ooblioob
New Contributor
15 years ago

SOAPUI creating "extra" attachments with MTOM

I'm trying to test a web service designed to read MTOM messages using SOAPUI and I've run into a rather peculiar problem. The schema defines an Attachment element with a place for the file and the filename (so we don't have to parse it from the content header). Here's the definition:

<xs:complexType name="Attachment">
<xs:sequence>
<xs:element name="File" type="xs:base64Binary"/>
<xs:element name="Filename" type="xs:string"/>
</xs:sequence>
</xs:complexType>

And a corresponding XML entry would look something like this:

<gwm:Attachment>
<gwm:File>cid:Test.txt</gwm:File>
<gwm:Filename>Test Filename.txt</gwm:Filename>
</gwm:Attachment>

I'm able to get SOAPUI to recognize the cid reference and can attach the file as expected, but when I examine the raw output I get the following:

<gwm:Attachment>
<gwm:File><inc:Include href="cid:Test.txt" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></gwm:File>
<gwm:Filename><inc:Include href="cid:http://www.soapui.org/265497349529065" xmlns:inc="http://www.w3.org/2004/08/xop/include"/></gwm:Filename>
</gwm:Attachment>

------=_Part_87_10957197.1299271524374
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <http://www.soapui.org/265497349529065>

Test Filename.txt
------=_Part_87_10957197.1299271524374
Content-Type: text/plain; charset=us-ascii; name=test.txt
Content-Transfer-Encoding: 7bit
Content-ID: <test.txt>
Content-Disposition: attachment; name="test.txt"; filename="test.txt"

This is a test for web services
------=_Part_87_10957197.1299271524374--

Essentially SOAPUI is creating TWO attachments, although I've only specified one. This is creating problems because the web service only expects one file. Can anyone explain what's going on, or if there's a workaround? Thanks!
No RepliesBe the first to reply