Hi, Im' using Axis2 1.4 and I can't seem to manage correctly Soap Faults.
This an excerpt from my wsdl:
<xsd:element name="FaultMessage" type="xsd:string"/>
<wsdl:message name="AuthFault">
<wsdl:part name="Message" element="tns:FaultMessage" />
</wsdl:message>
<!--portType section-->
<wsdl:operation name="MyOperation">
<wsdl:input message="tns:MyOperationIn" />
<wsdl:output message="tns:MyOperationOut" />
<wsdl:fault name="AuthFault" message="tns:AuthFault" />
</wsdl:operation>
<!-- binding section-->
<wsdl:operation name="MyOperation">
<soap:operation soapAction="urn:mycompany:myservice:MyOperation" />
<wsdl:input>
<soap:body use="literal" parts="parameters" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" parts="response"/>
</wsdl:output>
<wsdl:fault name="AuthFault">
<soap:fault name="AuthFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
wsdl2java (ADB binding) generates the class AuthFault, but when I throw this
Exception inside MyOperation service method the following is the SOAP message
sent:
<?xml version='1.0' encoding='UTF-8'?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>AuthFault</faultstring>
<detail />
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
The exception specific field is missing, and the client stub won't catch an
AuthFault exception (I am forced to catch a generic RemoteException and search
for the string "AuthFault" in its message field)
Another (less significant) undesired result is that axis logs the fault at
[ERROR] level: in order to avoid that should I set axis log to [FATAL] or there
is another way?
I can't figure out what's wrong with my code. Thanks a lot for any help (and
sorry if it's something obvious).
Alessandro
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]