Returning Enumeration or Exception from WebMethod?

Discussion in 'ASP .Net Web Services' started by Tobias Lekman, Aug 9, 2003.

  1. Hi,

    I am trying to raise an exception from within a WebMethod
    in my web service. Is this possible at all? If so, how do
    you do it?

    If this is not possible, then I would be happy to return
    an enumeration of response codes, but have been
    unsuccessful in declaring and returning an enumeration.
    Is this possible at all? If so, how do you do it?

    Regards,
    Tobias Lekman
     
    Tobias Lekman, Aug 9, 2003
    #1
    1. Advertising

  2. Tobias Lekman

    Marina Guest

    Putting a statement like 'throw new Exception()', will do it. Or just
    having a line of code that does it.

    What is returned is a SoapException object, I think. But this should have
    properties to let you drill down and get the contents of the original
    exception.

    "Tobias Lekman" <> wrote in message
    news:007501c35e98$83d1a3a0$...
    > Hi,
    >
    > I am trying to raise an exception from within a WebMethod
    > in my web service. Is this possible at all? If so, how do
    > you do it?
    >
    > If this is not possible, then I would be happy to return
    > an enumeration of response codes, but have been
    > unsuccessful in declaring and returning an enumeration.
    > Is this possible at all? If so, how do you do it?
    >
    > Regards,
    > Tobias Lekman
    >
     
    Marina, Aug 11, 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. puvit82
    Replies:
    4
    Views:
    763
    puvit82
    Feb 1, 2008
  2. Alex

    Returning ArrayList from WebMethod, best practices

    Alex, Jul 16, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    118
  3. patrick

    WebMethod returning XMLdataDocument

    patrick, Feb 11, 2004, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    253
    patrick
    Feb 11, 2004
  4. WebMethod returning a object in a COM dll

    , Feb 16, 2005, in forum: ASP .Net Web Services
    Replies:
    3
    Views:
    110
    Keenan Newton
    Feb 17, 2005
  5. cczona
    Replies:
    1
    Views:
    103
    Rick DeNatale
    Mar 26, 2010
Loading...

Share This Page