You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Naresh Agarwal <na...@yahoo.com> on 2001/12/04 16:29:59 UTC

SOAP Fault Generation

Hi

I am developing a Soap Server.

When a user accesses the function of this Service ), user can committ
following mistakes

1) User can call a function, which is not at all supported by Soap Server.
2) User can call a function (which is supported by Soap Server) with wrong
number of parameters.
3) User can call a function (which is supported by Soap Server) with wrong
paramter type.

In such a case, who is responsible for Soap error generation.

Would Soap Client (with the help of WSDL file) would take care of above
errors and generate a Soapfault OR

It is the *responsibility of Soap Server* to verify whether called
function's signature matches with the one Soap Server provides and to SEND
SOAP FAULT ELEMENTS IN ITS RESPONSE TO THE CLIENT.

Also even if send Soap Fault element in the Soap Response, can a user
(accessing the service) capture this fault element.

Thanks,
Regards,
Naresh Agarwal




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


Re: SOAP Fault Generation

Posted by Nicholas Quaine <nq...@soapuser.com>.
if client side error, then client should handle the error (generally called
a client side exception)
this can happen either at request generation time or response interpretation
time

but if the request arrives at the server and something goes wrong on the
server side (this includes both (a) the message contained bad number of
params or (b) the params supplied caused the method to fail in some way)
then the server sends a SOAP fault rather than a response containing the
method result

check the code below (apache soap java client excerpt)
notice that we check first if we received a fault before interpreting the
response
this is the client's way of picking up a server side fault

//setup the call
Call call = new Call();
call.setSOAPMappingRegistry(mySmr);
call.setTargetObjectURI(myServiceName);
call.setMethodName(myMethodName);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setParams(myParams);

//invoke the call
Response resp = call.invoke(new URL(myServletURLName), "");
    if (resp.generatedFault())
        //handle a server side error
    else
        //interpret result

regards,
Nicholas Quaine

Visit http://www.soapuser.com/

nquaine@soapuser.com


----- Original Message -----
From: "Naresh Agarwal" <na...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Tuesday, December 04, 2001 4:29 PM
Subject: SOAP Fault Generation


> Hi
>
> I am developing a Soap Server.
>
> When a user accesses the function of this Service ), user can committ
> following mistakes
>
> 1) User can call a function, which is not at all supported by Soap Server.
> 2) User can call a function (which is supported by Soap Server) with wrong
> number of parameters.
> 3) User can call a function (which is supported by Soap Server) with wrong
> paramter type.
>
> In such a case, who is responsible for Soap error generation.
>
> Would Soap Client (with the help of WSDL file) would take care of above
> errors and generate a Soapfault OR
>
> It is the *responsibility of Soap Server* to verify whether called
> function's signature matches with the one Soap Server provides and to SEND
> SOAP FAULT ELEMENTS IN ITS RESPONSE TO THE CLIENT.
>
> Also even if send Soap Fault element in the Soap Response, can a user
> (accessing the service) capture this fault element.
>
> Thanks,
> Regards,
> Naresh Agarwal
>
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>


Re: SOAP Fault Generation

Posted by Nicholas Quaine <nq...@soapuser.com>.
if client side error, then client should handle the error (generally called
a client side exception)
this can happen either at request generation time or response interpretation
time

but if the request arrives at the server and something goes wrong on the
server side (this includes both (a) the message contained bad number of
params or (b) the params supplied caused the method to fail in some way)
then the server sends a SOAP fault rather than a response containing the
method result

check the code below (apache soap java client excerpt)
notice that we check first if we received a fault before interpreting the
response
this is the client's way of picking up a server side fault

//setup the call
Call call = new Call();
call.setSOAPMappingRegistry(mySmr);
call.setTargetObjectURI(myServiceName);
call.setMethodName(myMethodName);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
call.setParams(myParams);

//invoke the call
Response resp = call.invoke(new URL(myServletURLName), "");
    if (resp.generatedFault())
        //handle a server side error
    else
        //interpret result

regards,
Nicholas Quaine

Visit http://www.soapuser.com/

nquaine@soapuser.com


----- Original Message -----
From: "Naresh Agarwal" <na...@yahoo.com>
To: <so...@xml.apache.org>
Sent: Tuesday, December 04, 2001 4:29 PM
Subject: SOAP Fault Generation


> Hi
>
> I am developing a Soap Server.
>
> When a user accesses the function of this Service ), user can committ
> following mistakes
>
> 1) User can call a function, which is not at all supported by Soap Server.
> 2) User can call a function (which is supported by Soap Server) with wrong
> number of parameters.
> 3) User can call a function (which is supported by Soap Server) with wrong
> paramter type.
>
> In such a case, who is responsible for Soap error generation.
>
> Would Soap Client (with the help of WSDL file) would take care of above
> errors and generate a Soapfault OR
>
> It is the *responsibility of Soap Server* to verify whether called
> function's signature matches with the one Soap Server provides and to SEND
> SOAP FAULT ELEMENTS IN ITS RESPONSE TO THE CLIENT.
>
> Also even if send Soap Fault element in the Soap Response, can a user
> (accessing the service) capture this fault element.
>
> Thanks,
> Regards,
> Naresh Agarwal
>
>
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>