If Accept-Type HTTP header is not set, JiBX/WS throws "Unsupported media type"
exception
----------------------------------------------------------------------------------------
Key: JIBX-258
URL: http://jira.codehaus.org/browse/JIBX-258
Project: JiBX
Issue Type: Bug
Components: JiBX/WS
Reporter: Nigel Charman
Assignee: Dennis Sosnoski
Exception is:
java.io.IOException: Unsupported media type 'xml'
org.jibx.ws.codec.CodecPool.getCodec(CodecPool.java:73)
org.jibx.ws.server.http.WsServletDelegate.doPost(WsServletDelegate.java:140)
org.jibx.ws.server.http.WsServlet.doPost(WsServlet.java:76)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
WsServletDelegate code is:
String outtype = CodecDirectory.TEXT_MEDIA_CODE;
String accepttype = req.getHeader("Accept");
if (accepttype != null) {
outtype = CodecDirectory.getBestMimeType(accepttype);
if (outtype == null) {
throw new ServletException("No supported media type in
Accept-Type from request: " + accepttype);
}
}
CodecDirectory.TEXT_MEDIA_CODE is set to "xml". Changing above code to have
String outtype = "text/xml" fixes the problem. I'm not sure of the best
solution - do we want to call the fullMimeType() method from the relevant
Protocol class, so we get either the SOAP 1.1 or SOAP 1.2 preferred types?
Presumably we will also need similar code for the preceding intype block of
code.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
jibx-devs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-devs