You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Mattias Norlander <um...@yahoo.com> on 2005/10/07 11:16:19 UTC

Multipart message parsing with javamail API

Hi!

I am accessing axis (v1.1) web services from a php
client.
When trying to send messages with attachments, the
server cannot process them. This is what I get:

Error in parsing mime data stream:  null
at
org.apache.axis.attachments.MultiPartRelatedInputStream.<init>(MultiPartRelatedInputStream.java:368)
 
After some debugging I figured out where the problem
was. The content type header sent from php looks like
this:

multipart/related; boundary="abc"; type=text/xml

Axis will then pass this data to the constructor for
javax.mail.internet.ContentType (sun javamail). This
constructor will then throw an exception. The
workaround is to add double quotes around the
"text/xml" part, like this:


multipart/related; boundary="abc"; type="text/xml"

... and everything works fine. The problem is this
cannot be done without altering the actual PHP soap
implementation. And also, as far as I can see, the
quotes are not mandatory. If you look at the examples
from w3, they don't use them:

http://www.w3.org/TR/2000/NOTE-SOAP-attachments-20001211#SOAPMultipart

So this might be a bug in axis (or possibly in
the javamail apis). So my question is...


Is this a bug in axis?
If so, can someone fix it?
Is there some sort of workaround available?


Regards, 

Mattias


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com