[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

throwing and handling exceptions in web services

Lachlan James

7/14/2003 5:22:00 AM

Hi,

I was just wondering how to best throw and catch
exceptions in web services.

I have created a web service that throws 3 or 4 different
types of exceptions. Depending on which exception is
thrown I would like the client to be able to act
accordingly, but how can the client catch an exception
that doesn't exist on their system?

Is there a better way to inform consuming code of
different errors that are occuring. I can't help but feel
if ms included the throws keyword like java we wouldn't
have this problem because the consuming code that is
generated would know about which exceptions a particular
service could throw.

Thanks,

Lachlan James
1 Answer

Lachlan James

7/17/2003 4:29:00 AM

0

I guess the best I can do is create a SoapException and
stick my exception details inside it. I guess that means
that the client will have to know about the different
exceptions they might encounter.

If anyone has any comments that would be helpful.

Thanks,

Lachlan

>-----Original Message-----
>Hi,
>
>I was just wondering how to best throw and catch
>exceptions in web services.
>
>I have created a web service that throws 3 or 4 different
>types of exceptions. Depending on which exception is
>thrown I would like the client to be able to act
>accordingly, but how can the client catch an exception
>that doesn't exist on their system?
>
>Is there a better way to inform consuming code of
>different errors that are occuring. I can't help but feel
>if ms included the throws keyword like java we wouldn't
>have this problem because the consuming code that is
>generated would know about which exceptions a particular
>service could throw.
>
>Thanks,
>
>Lachlan James
>.
>