[ https://issues.apache.org/jira/browse/AXIS2-2247?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Deepal Jayasinghe reassigned AXIS2-2247: ---------------------------------------- Assignee: Keith Godwin Chapman > Exception when invoking a service in RESTful manner using a generated stub > -------------------------------------------------------------------------- > > Key: AXIS2-2247 > URL: https://issues.apache.org/jira/browse/AXIS2-2247 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Affects Versions: nightly > Environment: winxp, Tomcat 5.5.16, jdk1.5 > Reporter: Charitha Kankanamge > Assigned To: Keith Godwin Chapman > > I created a service and deployed in tomcat. Then generated a stub using > wsdl2java (with adb). When I tried to invoke the service using a client in > RESTful manner, following exception occurs at the client side. > org.apache.axis2.deployment.ModuleDeployer deploy > INFO: Deploying module: addressing > Exception in thread "main" java.lang.RuntimeException: > java.lang.UnsupportedOperationException: The parser is already consumed! > at org.apache.ws.axis2.NulltestStub.fromOM(NulltestStub.java:1225) > at org.apache.ws.axis2.NulltestStub.sayHello(NulltestStub.java:162) > at emptycontext.main(emptycontext.java:64) > Caused by: java.lang.UnsupportedOperationException: The parser is already > consumed! > at > org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReader(OMElementImpl.java:670) > at > org.apache.axiom.om.impl.llom.OMElementImpl.getXMLStreamReaderWithoutCaching(OMElementImpl.java:652) > at org.apache.ws.axis2.NulltestStub.fromOM(NulltestStub.java:1219) > ... 2 more > I was able to invoke the same service in RESTful manner using a client which > used Axis2 client API. (using a payload). This issue occurs only if you use a > generated stub. > Following code was used to invoke the service in RESTful manner. > =========================================================================== > NulltestStub stub = new > NulltestStub("http://10.100.1.203:9763/axis2/services/nulltest"); > > > Options opts = stub._getServiceClient().getOptions(); > > opts.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE); > > > > NulltestStub.SayHello request = new NulltestStub.SayHello(); > request.setS("2"); > NulltestStub.SayHelloResponse response = stub.sayHello(request); > System.out.println("Response : " + response.get_return()); -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]