axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 14175] New: - SOAPConnection.call() not behaving properly when a SOAP Fault is returned
Date Fri, 01 Nov 2002 18:43:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14175>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=14175

SOAPConnection.call() not behaving properly when a SOAP Fault is returned

           Summary: SOAPConnection.call() not behaving properly when a SOAP
                    Fault is returned
           Product: Axis
           Version: 1.0-rc1
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: Chris.Bowley@genericsgroup.com


I am using the JAXM & SAAJ APIs to write some client code that must be portable 
across SOAP implementations. I find that the behaviour of Axis and the Java XML 
Pack Summer 02 differs radically when a SOAP Fault is returned from the server. 
In the following simple code fragment from my app where all the types are from 
the jaxm.xml.soap namespace:

	SOAPConnectionFactory connFctry = SOAPConnectionFactory.newInstance();
	SOAPConnection conn = connFctry.createConnection();
		
	// send the SOAP message and wait for the response
	SOAPMessage respMsg = conn.call(m_reqMsg, soapAddressURL);
	SOAPBody respBody = respMsg.getSOAPPart().getEnvelope().getBody();
	if (respBody.hasFault())
	{
	    m_responseFault = respBody.getFault();

the XML Pack returns a SOAPMessage from conn.call() which ultimately contains a 
SOAPFault whereas Axis throws a SOAPException with the cause set to an 
AxisFault in conn.call(). Some other sample code I have seen also assumes that 
a SOAP Fault will be returned the way the XML Pack does it.

Tracing through the Axis code I see that 
org.apache.axis.client.Call.invokeEngine() contains the lines

        SOAPBodyElement respBody = resEnv.getFirstBody();
        if (respBody instanceof SOAPFault) {
            throw ((SOAPFault)respBody).getFault();
        }

This first throw is caught and passed on a few times before returning to my 
code. I haven't gone into the code deeply enough to figure out what it would 
take to fix this.

For completeness here is the SOAP Response being sent back.
<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<soap:Fault>
<faultcode>client.gns.admin.test</faultcode>
<faultstring>test returned fault</faultstring>
<faultactor>tester</faultactor>
<detail>
<DetailString xmlns="http://vodafone.net/ns/gns/framework/1">This is a test
return message.</DetailString>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>

Mime
View raw message