
Please MS people: Question on Web Services and Custom Exception
Hi,
What I am trying to do, is to create a web service for a Web application.
First, I have a class library that contains my Exception Class (custom
exception).
I am importing this class into my web service, and at some point when
something
happens, I am raising this custom exception. Up to this point, everything if
fine.
The problem is that, in the Web Form (which I also imported the class
library), I am
accessing the service methods inside a try block but I can not catch my
exception.
Instead, I always get the following exception in the message.
System.Web.Services.Protocols.SoapException: Server was unable to process
request. ---> ClassLibrary1.MyException: Hello World at
WebService1.Service1.Thrower() in
c:\inetpub\wwwroot\WebService1\Service1.asmx.vb:line 51
As you can see Soap exception is thrown. My own exception is inside the
message together with
my message (in this case is Hello World) !!!
Can you throw a custom exception in a webservice or not? I would appreciate
if anybody
from MSFT would answer since nobody was able to do it up to now.
Thanks,
Theo. S.