Hallo,
I'm using Axis2 to create a service that is accessed in REST style.
The MyServiceMessageReceiverInOut class, which was generated by Axis2's WSDL2Java utility, causes the following exception when I access the service in REST style :
java.lang.UnsupportedOperationException: The parser is already consumed!
at org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:635)
[... more ...]
The following change to the method fromOM() in MyServiceMessageReceiverInOut fixed it :
public org.apache.xmlbeans.XmlObject fromOM(org.apache.axiom.om.OMElement param, java.lang.Class type, java.util.Map extraNamespaces) {
try {
if (MyRQDocument.class.equals(
type)) {
if (extraNamespaces != null) {
//
// replaced this line :
//
// return MyRQDocument.Factory.parse(param.getXMLStreamReaderWithoutCaching
(),
//
// by this line :
//
return MyRQDocument.Factory.parse(param.getXMLStreamReader(),
new
org.apache.xmlbeans.XmlOptions().setLoadAdditionalNamespaces(
extraNamespaces));
} else {
return MyRQDocument.Factory.parse(param.getXMLStreamReaderWithoutCaching
());
}
}
[... more ...]
Has someone had a similar error? Can someone explain what is going on here, and whether applying this fix is a viable solution?
thank you,
Heikki Doeleman
- [Axis2] Generated MyServiceMessageReceiverInOut using REST ... heikki
- Re: [Axis2] Generated MyServiceMessageReceiverInOut us... Ajith Ranabahu
