WebServices exceptions

P

Pete Davis

I just want to check my facts.

I've heard some differing accounts, but my understanding of an article I
read on the MSDN site is, if you throw an exception in a web service, the
exception is encapsulated in a SoapException, returned as a Soap <fault> and
the SoapException is thrown on the client. Is my understanding of this
correct?

I just want to make sure if I'm throwing exceptions in the web service that
the client is going to get them. I seem to recall some postings where people
were saying exceptions they were throwing in their web services weren't
being thrown on the client, but instead were causing issues in their web
service itself (crashing?). I don't recall how those topics were resolved,
however.

Thanks

Pete davis
 
T

Trebek

Nope, if you throw them, they will be caught at the client as a
SOAPException. However, a preferred way would be to catch the exception on
the web service end, fill out the detail node of the SOAPException, and have
the client catch that with the detail so they can understand what went
wrong.

Alex
 
P

Pete Davis

Okay, then I misunderstood that. I was under the impression that the
SoapException would have my exception as an InnerException. Thanks.

Pete
--
http://www.petedavis.net

Trebek said:
Nope, if you throw them, they will be caught at the client as a
SOAPException. However, a preferred way would be to catch the exception on
the web service end, fill out the detail node of the SOAPException, and have
the client catch that with the detail so they can understand what went
wrong.

Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top