I've included a fault response and excerpts from the WSDL
below. Will .NET and other implementations understand
this fault? If not, what do I need to do to get something
that most implementations will understand?
Note that the faultstring in the response below is empty.
However, I'll provide a human-understandable faultstring
using the following technique:
MyServiceBindingImpl {
doSomething() {
try {
// code that does the actual work
}
catch ( MyNonAxisSpecificException e ) {
throw new MyDetailedException( e );
}
}
}
MyNonAxisSpecificException will be very similar to an
AxisFault, but it won't be Axis-specific.
MyDetailedException was created by Axis, and it extends
MyBaseException which in turn extends AxisFault. A new
constructor (or similar) will be added to the axis-
generated MyDetailedException code which will take a
MyNonAxisSpecificException and fill out the various
fields, including faultstring.
----- BEGIN FAULT RESPONSE ----
<?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 xmlns:ns1="urn:MyNamespace">
<ns1:majorcode>1</ns1:majorcode>
<ns1:minorcode>2</ns1:minorcode>
</ns1:fault>
<ns2:exceptionName
xmlns:ns2="http://xml.apache.org/axis/">com.example.MyDet
ailedException</ns2:exceptionName>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
----- END FAULT RESPONSE ----
----- BEGIN WSDL EXCERPT ----
<wsdl:types>
<complexType name="MyBaseException">
<sequence>
<element name="majorcode" type="xsd:int"/>
<element name="minorcode" type="xsd:int"/>
</sequence>
</complexType>
</wsdl:types>
<complexType name="MyDetailedException">
<complexContent>
<extension base="tns1:MyBaseException">
<sequence/>
</extension>
</complexContent>
</complexType>
<wsdl:message name="MyDetailedException">
<wsdl:part element="tns1:fault" name="fault"/>
</wsdl:message>
<wsdl:portType name="MyServicePortType">
<wsdl:operation name="doSomething" parameterOrder="">
<wsdl:input message="impl:doSomethingRequest"
name="doSomethingRequest"/>
<wsdl:output message="impl:doSomethingResponse"
name="doSomethingResponse"/>
<wsdl:fault message="impl:MyDetailedException"
name="MyDetailedException"/>
</wsdl:operation>
<wsdl:binding name="MyServiceSOAPPortSoapBinding"
type="impl:MyServicePortType">
<wsdlsoap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="doSomething">
<wsdlsoap:operation soapAction="doSomething"/>
<wsdl:input name="doSomethingRequest">
<wsdlsoap:body namespace="MyNamespace" use="literal"/>
</wsdl:input>
<wsdl:output name="doSomethingResponse">
<wsdlsoap:body namespace="MyNamespace" use="literal"/>
</wsdl:output>
<wsdl:fault name="MyDetailedException">
<wsdlsoap:fault use="literal"/>
</wsdl:fault>
</wsdl:operation>
----- END WSDL EXCERPT ----