Hello.
I'm trying to build a client using .NET/C# that is capable of
communicating with an existing Webservice written in Java using Apache
Axis. Now, I've encountered a problem trying to retrieve binary data
(i.e. downloading files) which is sent by the service using the "SOAP
with attachments" format (as per
http://www.w3.org/TR/SOAP-attachments), i.e. as a MIME
multipart/related message. Apparently, the.NET Webservice library does
not seem to understand this form of message, at least I've not found a
way to make it accept one. The WSE doesn't help either, from what I
gather, it only provides support for DIME, which in turn the Web
Service is unable to provide.
The only promising approach I've found so far would be to create a
SoapExtension class (similar to what is described in the article at
http://msdn.microsoft.com/msdnmag/i...ds/default.aspx)
which, when added to the WebMethods that return MIME messages,
intercepts the response stream, parses the MIME content, extracts the
XML body and replaces the original MIME content with it and ... well, I
admit I'm not that far yet, but I suppose I just have to save the
attachments somewhere and find a way to pass them to the client calling
the method.
However, this seems to be a lot of work compared to the relative ease
with which it was possible to interface with other WebService methods
that didn't involve attachments, especially because it would require me
to write my own MIME parser... So if there's an easier way, I'd love to
hear about it. Any suggestions would be welcome. Thanks.
↧
Receiving a MIME attachment from a webservice.
↧