Having trouble parsing Multipart MIME Content.


I am working on an integration with IBM DB2 Content Manager.

IBM provides a generic SOAP 1.1 web service so I can’t utilize all the nice SOAP 1.2 features that WebMethods 7.1.2 provides.

So far, I have been able to get calls to the web service working correctly using “pub.client.Http”. I am having trouble parsing the results when file attachments are returned.

If I use a tool like “soapUI” I can get the raw results from the service call (see attached).
It correct parses the results and lists 1 file attachment.

Maybe I don’t understand “MIME” concepts enough to explain myself but as you can see, it appears this is multipart MIME contents.

The first part is plain text, XML containing the soap response from the web service call.
The second part is “Application/rtf”. Both parts have a tranfer encoding of binary.

In webMethods, I invoke the service “pub.client.Http” and return the results as a stream.
I then invoke “pub.mime.createMimeData” with the stream and get the part count.
It returns only “1” and the type is plain text. I would think I should be getting 2 parts.

I would think I should be able to get the first part (soap message) and parse that.
Then get the second part convert the contents to bytes and save the file.

Any idea what could be causing the problem.
Or possibly point me in the right direction to research this?


Hi Matt,
try this sequence
mergeHeaderAndBoby (use header/lines from http response)

Get part-0 and this will be the xml response data and remaining attachments.