[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

Returning Enumeration or Exception from WebMethod?

Tobias Lekman

8/9/2003 5:06:00 PM

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

1 Answer

Marina

8/11/2003 5:27:00 PM

0

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" <tobias.lekman@jkd.co.uk> wrote in message
news:007501c35e98$83d1a3a0$a301280a@phx.gbl...
> 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
>