Usually your WebService methods return objects that have error information
embedded in it. So SOAP/hard exception and application exceptions are
different.
Example in C#
class clsResponse
{
public bool bSuccess = true;
public string sErrMessage = "";
}
class clsRateQuoteResponse : clsResponse
{
public decimal dAmount;
}
[WebMethod]
public clsRateQuoteResponse GetRates(clsRateQuoteRequest rq)
{
try
{
...blablabla....
clsRateQuoteResponse rs = new clsRateQuoteResponse();
if( invalid zip code )
{
rs.bSuccess = falsel;
rs.sErrMessage = "Incorrect zip code";
return rs;
}
...balablabla....
rs.dAmount = $1000M;
rs.bSuccess = true;
return rs;
}
catch(Exception e)
{
....Log exception.......and throw SOAP exception
throw new Excpetion("Sorry, we have an internall error. Please try
again later");
}
}
So if it's a soft error (the one that can be fixed on receiving end like
fixing address for example) you end up with normal response,
For hard errors (like database just died) I prefer to log them/page admin
and respond with SOAP exception.
George.
>I would like to distinguish between two classes of exceptions thrown from
>my web service - one that is a standard exception that is not propogated to
[quoted text clipped - 11 lines]
>
> Paul
PJ6 - 20 Mar 2008 16:58 GMT
Ahh... yes that is a better way to do it.
Thanks,
Paul
> Usually your WebService methods return objects that have error information
> embedded in it. So SOAP/hard exception and application exceptions are
[quoted text clipped - 62 lines]
>>
>> Paul