Just wanted you to know of a one-line AXIS source code change I had to locally make in order for attachments to work with the "MS SOAP Toolkit 3.0".

The referenced attachment that AXIS sends back (say, with the urn:EchoAttachmentsService) to the client has an "href" attribute in the body that looks something like...

cid:987623414253512151413145151

The actual DIME attachment has an ID that does *not* have the "cid:"; prefix. It appears that the MS SOAP Toolkit 3.0 is confused by this since it is expecting a "more proper" match (not sure exactly what matching algorithm it uses here).

In order to get this to work, I had to change...

org\apache\axis\attachments\AttachmentPart.java

as follows...

public String getContentIdRef() {
// Original version.
//return Attachments.CIDprefix + getContentId();

// The below version allows MSSOAP Tookit 3.0 to work. They get confused because
// the href attribute has something like "cid:1234...."; but the attachment itself
// just has 1234... *without* the cid: prefix.
return getContentId();
}


I compiled just this file and placed its .class file in...

<axis-install>\webapps\axis\WEB-INF\classes\org\apache\axis\attachments

After restarting Tomcat, this altered .class file kicked in and produced responses without the "cid:"; prefix.

This allowed me to write "MS SOAP Toolkit 3.0" clients that could read referenced attachments in a SOAP response from AXIS.

Microsoft seems to use a prefix of "uuid:" but they use it both in the href attribute and in the attachment id whereas AXIS uses "cid:"; in the href attribute but not in the attachment id.

I don't know much about the meaning of the "cid:"; prefix but, if you want outgoing attachments to work with "MS SOAP Toolkit 3.0", I think the only options are to remove the "cid:"; prefix in the href attribute OR include the "cid:"; prefix in the attachment id.

In case you're interested, I just posted a much longer email to axis-user that describes my (successful) efforts to achieve attachment interoperability between AXIS and both "MS SOAP Toolkit 3.0" and "Web Services Enhancements 1.0" (the two MS technologies that speak attachments).

The only other thing I might mention from that posting is the desire for org.apache.axis.wsdl.WSDL2Java to support the DIME extension to the WSDL. This would make dealing with attachments on the client side a no-brainer.

Thanks for a wonderful tool. AXIS rocks!

Sam Brow

Reply via email to