Hello everyone,
I would like to explain this "vision" / problem in a more abstract
manner with the following code example:
----------------------------------------
WSDL
----------------------------------------
<wsdl:operation name="operationName">
<wsdl:fault name="FirstFault" message="nsp:FirstFault" />
<wsdl:fault name="SecondFault" message="nsp:SecondFault" />
</wsdl:operation>
----------------------------------------
----------------------------------------
Server
----------------------------------------
if (condition == 23) {
FirstFault exception = new FirstFault ("Condition was 23!");
exception.setMySpecialInfo(1234);
throw exception; // doesn't work since FirstFault is not throwable
// do we need to work with WsbfUtils.convertToFault()?
}
if (condition == 42) {
FirstFault exception = new SecondFault ("Condition was 42!");
exception.setOtherInfo(4321);
throw exception; // doesn't work since SecondFault is not throwable
// do we need to work with WsbfUtils.convertToFault()?
}
----------------------------------------
----------------------------------------
Client
----------------------------------------
MyServiceProxy client = new MyServiceProxy(TestClient.wsEpr);
try {
Element responseElement = TestClient.client.operationName
(requestElement);
} catch (FirstFault) { // doesn't work since the proxy does only
throw SoapFaults
// do s.th.
// should we "tunnel" internal exceptions through a SoapFault?
// how can we integrate custom exception in SoapFaults w/o
loosing any information?
} catch (SecondFault) { // doesn't work since the proxy does only
throw SoapFaults
// do s.th. different
// should we "tunnel" internal exceptions through a SoapFault?
// how can we integrate custom exception in SoapFaults w/o
loosing any information?
}
----------------------------------------
I would be very glad to get some support with this - I've to admin:
basic - issue. Unfortunately the Muse samples define a couple of
"wsdl:faults" but do not handle them within the code. I think the
approach mentioned above is more or less the way Axis2 is handling
exceptions.
Regards, Alex
Am 23.07.2007 um 15:02 schrieb [EMAIL PROTECTED]:
Hi,
we have some Exceptions specified in a WSDL file like:
<wsdl:operation name="getStatus">
<wsdl:input message="nsp:getStatus"
wsa:Action="http://ist_phosphorus.eu/nsp/webservice/reservation/
getStatus"/>
<wsdl:output message="nsp:getStatusResponse"
wsa:Action="http://ist_phosphorus.eu/nsp/webservice/reservation/
getStatusResponse"/>
<wsdl:fault name="FaultName"
message="nsp:NetworkReservationException"/>
</wsdl:operation>
The NetworkReservationException extends BaseFault and has several
private
attributes.
We'd like to throw this Exception on Serverside and catch it at
Client.
(just like axis2 does) But we can only get SoapFaults (BaseFaults)
without
any Attributes specified in the WSDL file.
My question is, is it possible to handle Exceptions that way and if
not:
what is the definition in the wsdl file good for?
Thanks for your help!
Jan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]