Error in Http Header in SOAP Message "Unable to parse mediaType ' *; q=.2'" using JibXWS 1.2.3

825 Views Asked by At

I have a web service that accepts SOAP messages relating to opentravel.org OTA specified XML messages, using Tomcat 7.0.25 and JibxWS.

I have tested using SOAPUI and it all works fine, however now a real client wishes to start using the service I get this error when they connect:

May 17, 2012 2:05:55 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [siteminder] in context with path [/webservice]     threw exception [Error parsing media type in accept-type from request: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2] with root cause
java.text.ParseException: Unable to parse mediaType ' *; q=.2'
        at org.jibx.ws.codec.MediaType.<init>(MediaType.java:130)
    at org.jibx.ws.codec.CodecDirectory.parseAcceptString(CodecDirectory.java:244)
    at org.jibx.ws.codec.CodecDirectory.getAcceptableMediaType(CodecDirectory.java:217)
    at org.jibx.ws.http.servlet.WsServletDelegate.getAcceptableMediaType(WsServletDelegate.java:217)
    at org.jibx.ws.http.servlet.WsServletDelegate.doPost(WsServletDelegate.java:121)
    at org.jibx.ws.http.servlet.WsServlet.doPost(WsServlet.java:76)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1805)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

So, in the http header of the request they are including an Accept with the value of:

text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

When I add this to my SOAPUI I can reproduce the error, it works fine without the ", *; q=.2, /; q=.2" bit.

So I have been looking for a way of being able to accept the ", *; q=.2, /; q=.2" bit of the accepts header.

What does the ", *; q=.2, /; q=.2" relate to? Is it to do with SOAP 1.2 which I know the JibX WS doesn't support? Although the client says they are using SOAP 1.1 with spring saaj13 implementation.

I am thinking there may be some configuration file that I just add these bits to, to say they can be handled, or to ignore them.

I have looked in the jibxWS jar at the properties file, and at my Tomcat server web.xml mime types and I am now going to try look through the source code of the JibX WSServlet and investigate more about spring saaj13 to see if I can find the answer.

Any suggestions would be most welcome. Thanks for your time.

0

There are 0 best solutions below