Content-Type not parsed correctly in MTOM SOAP 1.2 messages
-----------------------------------------------------------
Key: AXIS2-4076
URL: https://issues.apache.org/jira/browse/AXIS2-4076
Project: Axis 2.0 (Axis2)
Issue Type: Bug
Affects Versions: 1.4.1
Environment: soapUI 2.0.2, Axis2 1.4.1
Reporter: Frank Bitzer
Priority: Blocker
I'm using soapUI to send MTOM-optimized messages to an SOAP 1.2 endpoint. The
message looks like this:
POST
/webservice/services/ECTooRemotingService.ECTooRemotingServiceHttpSoap12Endpoint
HTTP/1.1
Content-Type: multipart/related; type="application/xop+xml"; start="<[EMAIL
PROTECTED]>"; start-info="application/soap+xml; action=\"urn:upload\"";
boundary="----=_Part_10_5804917.1223557742343"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 127.0.0.1:8080
Content-Length: 838
------=_Part_10_5804917.1223557742343
Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml;
action=\"upload\""
Content-Transfer-Encoding: 8bit
Content-ID: <[EMAIL PROTECTED]>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
xmlns:web="http://webservice.ecToo.jw.de">
<soap:Header/>
<soap:Body>
<web:upload>
<!--Optional:-->
<web:data>
<inc:Include href="cid:283151386895"
xmlns:inc="http://www.w3.org/2004/08/xop/include"/>
</web:data>
</web:upload>
</soap:Body>
</soap:Envelope>------=_Part_10_5804917.1223557742343Content-Type:
application/octet-streamContent-Transfer-Encoding: binaryContent-ID:
<283151386895>(FILE CONTENT HERE)------=_Part_10_5804917.1223557742343--
However, Axis2 throws an exception with the following stacktrace:
org.apache.axis2.AxisFault: Invalid Content Type Field in the Mime Message
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:283)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:133)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:842)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:648)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)
Caused by: org.apache.axiom.om.OMException: Invalid Content Type Field in the
Mime Message
at
org.apache.axiom.attachments.Attachments.<init>(Attachments.java:175)
at
org.apache.axis2.builder.BuilderUtil.createAttachments(BuilderUtil.java:586)
at
org.apache.axis2.builder.BuilderUtil.createAttachmentsMap(BuilderUtil.java:532)
at
org.apache.axis2.builder.MIMEBuilder.processDocument(MIMEBuilder.java:38)
at
org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:164)
at
org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:270)
... 20 more
Caused by: javax.mail.internet.ParseException: Missing ';'
at javax.mail.internet.ParameterList.<init>(ParameterList.java:136)
at javax.mail.internet.ContentType.<init>(ContentType.java:72)
at
org.apache.axiom.attachments.Attachments.<init>(Attachments.java:173)
... 26 more
I think the problem is either the line
Content-Type: multipart/related; type="application/xop+xml"; start="<[EMAIL
PROTECTED]>"; start-info="application/soap+xml; action=\"urn:upload\"";
boundary="----=_Part_10_5804917.1223557742343"
or the line
Content-Type: application/xop+xml; charset=UTF-8; type="application/soap+xml;
action=\"upload\""
in the header. It looks like Axis2 is not able to parse the escaped " in
action=\"upload\"" correctly. But according to the XOP specification it is
allowed, so soapUI does nothing wrong here.
There is a related problem report on this topic for Axis2-C:
https://issues.apache.org/jira/browse/AXIS2C-1124
Also note that when using SOAP 1.1 everything works fine, since the header
looks slightly different and there is no action specified in the start-info:
POST
/webservice/services/ECTooRemotingService.ECTooRemotingServiceHttpSoap11Endpoint
HTTP/1.1
SOAPAction: "urn:upload"
Content-Type: multipart/related; type="application/xop+xml"; start="<[EMAIL
PROTECTED]>"; start-info="text/xml";
boundary="----=_Part_7_18580800.1223557231953"
MIME-Version: 1.0
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 127.0.0.1:8080
Content-Length: 813
...
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]