I am working on a C# .NET project that needs to call webservices on a Java Servlet based application to retrieve data. Unfortunately the Java application does not provide w3 compliant webservices, but seems to be using something called SAAJ. For simple method calls I can make it work in .NET by fixing the WSDLs from the Java service manually (se previous post on this). But some of the methods returns attachments in addition to the SOAP xml, and this is my current problem.
The attachments are returned by using Content-Type: "multipart/related" in the http response, and then send the attachment as a separate mime part. I captured the output using Fiddler:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_4_1955909.1254433254265"
Transfer-Encoding: chunked
Date: Thu, 01 Oct 2009 21:40:54 GMT
7ee
------=_Part_4_1955909.1254433254265
Content-Type: text/xml; charset=utf-8
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><hasMessage xmlns="http://service.ebms.edi.cecid.hku.hk/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" type="xsd:string">true</hasMessage></SOAP-ENV:Body></SOAP-ENV:Envelope>
------=_Part_4_1955909.1254433254265
Content-Type: application/octream
Content-ID: <Payload-0>
... BINARY DATA ...
------=_Part_4_1955909.1254433254265--
0
So, have anyone got any experience with this? I was hoping that there was some library that could solve this issue for me, but so far I haven't found anything.
I know that .NET supports the MTOM standard through WSE3, which uses a similar technique for sending binary data. However this method uses a reference to the attached data in he SOAP XML, so my initial thought was that this will not work. Have anyone got any experience with this?