Question

I need to send a binary attachment to a JAVA webservice via SwA (Soap with Attachments). After discovering that .Net does not support SwA I am writing my own client. How do I encode the binary MIME attachment, so that the Java service will be able to decode it?

Was it helpful?

Solution

The answer is: you don't encode it. It is simply added as raw bytes.

OTHER TIPS

I suggest you look at the various MIME RFC, mostly it uses Base64 which thankfully .NET already handles.

I realize this question is old, but others may be looking for a similar answer.

Are you sure you need to write your own client - .NET WSE has support for MTOM for a long time, and MTOM was designed to be backward compatible with SwA.. I would look into this and try MTOM before attempting to write my own client.

You may want to look at the System.Net and System.Net.Mime namespaces. Some of the work there may be done for you.
Particularly look at System.Net.Mail.Attachment.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top