Ensure that mail.jar (Java Mail) and activation.jar (Java Activation Framework) are included in your Axis deployment. They are needed both on the server and client sides.
DIME attachment problems
The default client transport handler has problems sending and receiving attachments in DIME format. For large attachments (more than 1MB, or 8 chunks), an exception will be raised about corrupted stream data, or end of physical stream when more DIME chunks expected.
A workaround to this problem is to switch to the transport handler that uses commons-http-client.
For this, download commons-http-client-3.0 and commons-codec 1.3 from the jakarta site, add the jars to the client classpath, and modify the client-config.wsdd file to ensure that it uses the correct handler:
<deployment name="defaultClientConfig" ...> <transport name="http" pivot="java:org.apache.axis.transport.http.CommonsHTTPSender"/> ... </deployment>
Disappearing Attachments (AKA java.io.IOException: Resource has been deleted.)
If you are getting a "Resource has been deleted" IOException when trying to access an attachment, make sure you have not told the request SOAPMessage to write out anywhere. For example:
// Build the SOAP message out of the HTTP request. SOAPMessage request = getSoapRequest(); // Output message for debugging purposes or whatever. request.writeTo( System.out );
If you later try to access one of the request's AttachmentParts and write out its contents, you'll get the "Resource has been deleted" exception.