WebServices exceptions

Discussion in 'ASP .Net Web Services' started by Pete Davis, Feb 4, 2004.

  1. Pete Davis

    Pete Davis Guest

    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

    --
    http://www.petedavis.net
     
    Pete Davis, Feb 4, 2004
    #1
    1. Advertising

  2. Pete Davis

    Trebek Guest

    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

    "Pete Davis" <> wrote in message
    news:...
    > 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
    >
    > --
    > http://www.petedavis.net
    >
    >
     
    Trebek, Feb 4, 2004
    #2
    1. Advertising

  3. Pete Davis

    Pete Davis Guest

    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" <> wrote in message
    news:40212ef9$0$82256$...
    > 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
    >
    > "Pete Davis" <> wrote in message
    > news:...
    > > 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
    > >
    > > --
    > > http://www.petedavis.net
    > >
    > >

    >
    >
     
    Pete Davis, Feb 4, 2004
    #3
  4. Pete Davis

    Jan Tielens Guest

    Here's an article that shows how you can create some wrapper classes to make
    life with SoapExceptions easier:
    http://tinyurl.com/25j4q

    --
    Greetz

    Jan Tielens
    ________________________________
    Read my weblog: http://weblogs.asp.net/jan


    "Pete Davis" <> wrote in message
    news:...
    > 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" <> wrote in message
    > news:40212ef9$0$82256$...
    > > 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
    > >
    > > "Pete Davis" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > > --
    > > > http://www.petedavis.net
    > > >
    > > >

    > >
    > >

    >
    >
     
    Jan Tielens, Feb 5, 2004
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jib

    Webservices and OLE object

    jib, Jul 8, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    389
  2. Ahmed Moustafa
    Replies:
    5
    Views:
    30,037
    Chris Smith
    Jul 14, 2004
  3. Paul Miller
    Replies:
    3
    Views:
    1,022
    Alex Martelli
    Nov 12, 2003
  4. Replies:
    3
    Views:
    613
    Sherm Pendley
    Apr 16, 2007
  5. Lie
    Replies:
    3
    Views:
    635
Loading...

Share This Page