Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
1.5.1
-
None
-
None
-
Windows XP, JBoss 4.3, Spring Framework, Axis2 embedded in app war
Description
I get this error on the client side:
Transport level information does not match with SOAP Message namespace URI
at org.apache.axis2.builder.BuilderUtil.validateSOAPVersion(BuilderUtil.java:768)
at org.apache.axis2.builder.SOAPBuilder.processDocument(SOAPBuilder.java:62)
at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
This happens because the response header Content-Type is text/xml.
Background:
I use Soap1.2. My request contains Content-Type: application/soap+xml;charset=UTF-8, doesn't have SOAPAction header (to avoid Soap1.1 processing) and the soap envelope is serialized by Soap1.2 formatter.
On the server side I have the same setup: Soap1.2 formatter, the messageType on the response message context is set to application/soap+xml, I tried to set HTTP Content-Type header manually as per <a href="http://www.keith-chapman.org/2008/10/axis2-setting-custom-http-headers-on.html">here</a>.
I have disabled REST in axis2.xml and enabled content negotiation, but that didn't fix anything.
The problem is that the org.apache.axis2.transport.http.AxisServlet class hardcodes the contenttype on line 160:
response.setContentType("text/xml; charset="
+ msgContext
.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING));
I suggest replacing "text/xml" part with msgContext.getProperty(Constants.MESSAGE_TYPE) and hardcoding if not set.
Attachments
Issue Links
- duplicates
-
AXIS2-4712 remove hardcoded setting of content-type to text/xml from AxisServlet
- Resolved