[ http://issues.apache.org/jira/browse/AXIS2-1831?page=comments#action_12456266 ] Na Wang commented on AXIS2-1831: --------------------------------
Every generated stub and every operation. Here is the code: ------------------------------------------- try{ org.apache.axis2.client.OperationClient _operationClient = _serviceClient.createClient(_operations[11].getName()); _operationClient.getOptions().setAction(""); _operationClient.getOptions().setExceptionToBeThrownOnSOAPFault(true); // create SOAP envelope with that payload org.apache.axiom.soap.SOAPEnvelope env = null; env = toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()), param52, optimizeContent(new javax.xml.namespace.QName("", "readPInstance"))); // create message context with that soap envelope org.apache.axis2.context.MessageContext _messageContext = new org.apache.axis2.context.MessageContext() ; _messageContext.setEnvelope(env); // add the message contxt to the operation client _operationClient.addMessageContext(_messageContext); //execute the operation client _operationClient.execute(true); org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext( org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE); org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope(); java.lang.Object object = fromOM( getElement(_returnEnv,"document"), com.ipics.spm.soap.config.SensorProxyInstance.class, getEnvelopeNamespaces(_returnEnv)); _messageContext.getTransportOut().getSender().cleanup(_messageContext); return (com.vialogy.PInstance)object; }catch(org.apache.axis2.AxisFault f){ org.apache.axiom.om.OMElement faultElt = f.getDetail(); System.out.println("detail:"+f.getDetail()); System.out.println("detail:"+f.getReason()); .... throw f; } ---------------------------------------------------------------- You can see the catch statement, the AxisFault doesn't have f.getDetail(), getReason(), printed out is null, getMessage() print out to be the faultString. From the server side(see bellow), the SOAP envelope has both faultString and detail, however it didn't pass to AxisFault. I am using axis2 version 1.0, version 1.1 doesn't look like uch different from 1.0 in generating stubs. -------------------------------------------------------------------------------------------------------------------------- <xml vers ion="1.0" encodi ng="UTF-8"?>.<SO AP-ENV:Envelope xmlns:SOAP-ENV=" http://schemas.x mlsoap.org/soap/ envelope /" xmlns :SOAP-ENC="http: //schemas.xmlsoa p.org/soap/encod ing/" xmlns:xsi= "http://www.w3.o rg/2001/XMLSchem a-instan ce" xmln s:xsd="http://ww w.w3.org/2001/XM LSchema"xmlns:s pm="urn:spm"> <SOAP-ENV:Body> <SOAP-ENV:Fault><faultcode>SOAP-ENV: Server</faultcode> <faultstring>Soap processing error</faultstring><detail>Null or invalid SOAP object received at server.</detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ------------------------------------------------------------------------------------------------------------------------ > There is a bug in generated stub, it can not get AxisFault detail or reason > when server side respond with an envelope that has fault string and fault > detail > ------------------------------------------------------------------------------------------------------------------------------------------------------------ > > Key: AXIS2-1831 > URL: http://issues.apache.org/jira/browse/AXIS2-1831 > Project: Apache Axis 2.0 (Axis2) > Issue Type: Bug > Environment: window > Reporter: Na Wang > Priority: Critical > > There is a bug in generated stub, when server send a fault SOAP envelope, the > generated sub couldn't get the AxisFault detail and reason, it only get the > faultString. So AXIS2 client has no way of knowing the server side fault > detail or reason. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]