Hello,

I have written some web services using Axis2 1.1. They've been working 
reasonably well.
I've now enabled my web service calls to throw an AxisFault with a simple error.

My service implementation class throws an AxisFault created this way.

            throw new AxisFault(new QName("http://aaa.com";, "EnaWSFault", 
"test"), "Bad parameters",
                    new Exception("Bad device filter parameters"));


My client simply calls the stub and invokes this operation. When there is a 
fault, the AxisFault is not handled
elegantly and I get the exception:

org.apache.axiom.om.OMException: java.lang.IllegalStateException: Current state 
not START_ELEMENT
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:199)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.buildNext(OMElementImpl.java:554)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.getFirstOMChild(OMElementImpl.java:565)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.getChildren(OMElementImpl.java:279)
        at 
org.apache.axiom.soap.impl.llom.SOAPFaultImpl.getChildWithName(SOAPFaultImpl.java:185)
        at 
org.apache.axiom.soap.impl.llom.SOAPFaultImpl.getCode(SOAPFaultImpl.java:101)
        at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295)
        at 
com.emprisa.ena.ws.client.DeviceServiceStub.listDevices(DeviceServiceStub.java:909)
        at 
com.emprisa.ena.ws.client.DeviceServiceInvoker.invokeListDevices(DeviceServiceInvoker.java:76)
        at 
com.emprisa.ena.ws.client.DeviceServiceInvoker.main(DeviceServiceInvoker.java:57)
Caused by: java.lang.IllegalStateException: Current state not START_ELEMENT
        at 
com.ctc.wstx.sr.BasicStreamReader.getAttributeCount(BasicStreamReader.java:582)
        at 
org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuilder.java:130)
        at 
org.apache.axiom.om.impl.mtom.MTOMStAXSOAPModelBuilder.createOMElement(MTOMStAXSOAPModelBuilder.java:126)
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:125)
        ... 9 more
RemoteException in listdevices: java.lang.IllegalStateException: Current state 
not START_ELEMENT

The code in method DeviceServiceStub.listDevices() is catching an AxisFault but 
at runtime looks like that fault is
not being thrown by the _operationClient.execute(true); line (which is line 909)


When the service generates a fault, this is how the response looks in TCPmon.

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";><soapenv:Header
/><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>Bad
 parameters; nested exception is:
        java.lang.Exception: Bad device filter 
parameters</faultstring><detail><Exception>org.apache.axis2.AxisFault: Bad
parameters; nested exception is:
        java.lang.Exception: Bad device filter parameters
        at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:184)
        at 
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:493)
        at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:324)
        at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:234)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
        at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
        at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
        at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at 
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:432)
        at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
        at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
        at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
        at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
</Exception></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>
3b

--MIMEBoundaryurn_uuid_2237363A7411511C1E11646456980741--
0


I have seen similar posts with responses that suggested to use latest 1.0 
lightly. Is this still an issue in 1.1 or am
I doing something wrong?

Thanks,
Sathija.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to