0

When I attempt to consume a webservice running on JBoss 4.0.2, it returns the following error

org.apache.axis2.AxisFault: java.io.UnsupportedEncodingException: utf-8,text/xml
    at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:83)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.sendUsingOutputStream(CommonsHTTPTransportSender.java:330)
    at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:213)
    at org.apache.axis2.engine.AxisEngine.sendFault(AxisEngine.java:530)
    at org.apache.axis2.transport.http.AxisServlet.handleFault(AxisServlet.java:414)
    at org.apache.axis2.transport.http.AxisServlet.processAxisFault(AxisServlet.java:377)
    at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:165)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
    ...
Caused by: javax.xml.stream.XMLStreamException: java.io.UnsupportedEncodingException: utf-8,text/xml
    at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:257)
    at com.ctc.wstx.stax.WstxOutputFactory.createXMLStreamWriter(WstxOutputFactory.java:124)
    at org.apache.axiom.om.util.StAXUtils$5.run(StAXUtils.java:252)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.axiom.om.util.StAXUtils.createXMLStreamWriter(StAXUtils.java:248)
    at org.apache.axiom.om.impl.MTOMXMLStreamWriter.<init>(MTOMXMLStreamWriter.java:94)
    at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:470)
    at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:79)
    ... 30 more
Caused by: java.io.UnsupportedEncodingException: utf-8,text/xml
    at sun.nio.cs.StreamEncoder.forOutputStreamWriter(StreamEncoder.java:42)
    at java.io.OutputStreamWriter.<init>(OutputStreamWriter.java:83)
    at com.ctc.wstx.stax.WstxOutputFactory.createSW(WstxOutputFactory.java:253)

Searching around, it seems to be an issue with JAX-WS. Here are a couple of bug reports that support this conclusion

It's difficult to tell which version of JAX-WS is included with JBoss, as it is actually part of the AXIS2 package, but my best guess is that it is version 1.4. Is there a workaround to this issue with JBoss, or does it require a different version of JAX-WS? I am not familiar at all with JBoss, so I don't know if I could just swap out the JAR with a newer version.

RHPT
  • 2,560
  • 5
  • 31
  • 43
  • how do you consume this web service deployed in jboss – UVM Apr 15 '12 at 03:39
  • Via a http-post. Passing in the xml and content-type as http headers. – RHPT Apr 15 '12 at 16:08
  • I have a similar problem. But I'm using Spring, do you have a solution now? [link](http://stackoverflow.com/questions/17156274/couldnt-create-soap-message-due-to-exception-unable-to-create-stax-reader-or-w) – digao_mb Jun 17 '13 at 22:36

0 Answers0