throwing and handling exceptions in web services

Discussion in 'ASP .Net Web Services' started by Lachlan James, Jul 14, 2003.

  1. 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
     
    Lachlan James, Jul 14, 2003
    #1
    1. Advertising

  2. 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
    >.
    >
     
    Lachlan James, Jul 17, 2003
    #2
    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. C

    Throwing Exceptions

    C, Nov 6, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    374
    Kevin Spencer
    Nov 6, 2003
  2. =?Utf-8?B?Q2xpdmU=?=

    Throwing Exceptions

    =?Utf-8?B?Q2xpdmU=?=, Feb 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    342
    S. Justin Gengo
    Feb 20, 2004
  3. Richard Maher
    Replies:
    38
    Views:
    1,096
    Larry K. Wollensham
    Apr 15, 2009
  4. Gian U. Uy

    Throwing custom exceptions in web services using VS.Net

    Gian U. Uy, Nov 30, 2003, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    166
    Gian U. Uy
    Dec 4, 2003
  5. John
    Replies:
    4
    Views:
    449
Loading...

Share This Page