A href attribute within an exception sent via SOAP is not resolved by the
axis client.
The generation of the SOAP exception on the server side works perfectly.

The reason is in org.apache.axis.client.Call.invokeEngine.
There is no deserialization and only the first node of the body (
<soapenv:Fault>) is used to create an axis fault.
The <multiRef ...> elements are ignored so this information get lost.


Is this the intention or is it a bug? Will this functionality be
implemented in future?



Thanks in advance
Thomas



code snippet org.apache.axis.client.Call.invokeEngine:

    private void invokeEngine(MessageContext msgContext) throws AxisFault {

...

        SOAPEnvelope resEnv = resMsg.getSOAPEnvelope();

        SOAPBodyElement respBody = resEnv.getFirstBody();
        if (respBody instanceof SOAPFault) {
            if(operation == null ||
                    operation.getReturnClass() == null ||
                    operation.getReturnClass() !=
                        javax.xml.soap.SOAPMessage.class)
                for (int i = 1; i < resEnv.body.bodyElements.length; ++i) {
                    respBody.addChildElement(resEnvBody.bodyElements.[i]);
                        }
                throw ((SOAPFault)respBody).getFault();
        }

...



SOAP-Example:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance";>
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode>soapenv:Server.generalException</faultcode>
   <faultstring></faultstring>
   <detail>
    <ns1:fault href="#id0" xmlns:ns1="urn:WDC_ServerSoap"/>
    <ns2:exceptionName xmlns:ns2
="http://xml.apache.org/axis/";>Homag.WoodCommander.WDC_Server.Soap.WdcServerException</ns2:exceptionName>
    <ns3:stackTrace xmlns:ns3="http://xml.apache.org/axis/";>AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode:
 faultString:
 faultActor: null
 faultNode: null
 faultDetail:
      exceptionName: Homag.WoodCommander.WDC_Server.Soap.WdcServerException
      at
Homag.WoodCommander.WDC_Server.Soap.WDC_ServerSoapSoapBindingImpl.setup(WDC_ServerSoapSoapBindingImpl.java:105)

...

</ns3:stackTrace>
   </detail>
  </soapenv:Fault>
  <multiRef id="id0" soapenc:root="0" soapenv:encodingStyle
="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type
="ns4:WdcServerException" xmlns:soapenc
="http://schemas.xmlsoap.org/soap/encoding/"; xmlns:ns4
="urn:WDC_ServerSoap">
   <Data href="#id1"/>
   <Data href="#id2"/>
   <Data href="#id3"/>
  </multiRef>
  <multiRef id="id2" soapenc:root="0" soapenv:encodingStyle
="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns5:ExceptionData"
xmlns:ns5="urn:WDC_ServerSoap" xmlns:soapenc
="http://schemas.xmlsoap.org/soap/encoding/";>
   <Number xsi:type="xsd:int">2</Number>
   <IsNlsText xsi:type="xsd:boolean">false</IsNlsText>
   <Text xsi:type="xsd:string">Error %ld</Text>
   <FilledText xsi:type="xsd:string">Error 1</FilledText>
   <SourceFunction xsi:type="xsd:string">sourceFunction</SourceFunction>
   <SourceFileName xsi:type="xsd:string">SourceFileName</SourceFileName>
   <SourceLineNumber xsi:type="xsd:int">123</SourceLineNumber>
   <FillingWords xsi:type="xsd:string">1</FillingWords>
   <FillingWords xsi:type="xsd:string"></FillingWords>
   <Category xsi:type="xsd:int">1</Category>
   <Priority xsi:type="xsd:int">2</Priority>
  </multiRef>
  <multiRef id="id1" soapenc:root="0" soapenv:encodingStyle
="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns6:ExceptionData"
xmlns:ns6="urn:WDC_ServerSoap" xmlns:soapenc
="http://schemas.xmlsoap.org/soap/encoding/";>

...

  </multiRef>
  <multiRef id="id3" soapenc:root="0" soapenv:encodingStyle
="http://schemas.xmlsoap.org/soap/encoding/"; xsi:type="ns7:ExceptionData"
xmlns:ns7="urn:WDC_ServerSoap" xmlns:soapenc
="http://schemas.xmlsoap.org/soap/encoding/";>

...

  </multiRef>
 </soapenv:Body>
</soapenv:Envelope>




Reply via email to