Hi, exception coming from a web service has to be the SoapException.
All custom exceptions thrown from the web service code are automatically
converted to the SoapException, so this is the only exception type you see
at the client side.
However if you throw a SoapException from your web service code, it is not
going to be converted twice and you can use Detail property so send any
custom information you want. On the client side you need to catch
SoapException and do error handling based on the Detail field.
This article contains an example of using SoapException.Detail:
http://msdn.microsoft.com/library/de...etailtopic.asp
--
Thanks,
Eugene
-------------------------
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"René" <re**@convide1.dk> wrote in message
news:08****************************@phx.gbl...
Hey,
I'm trying to throw an exception through to SOAP-
protocol. Like this:
throw new SoapException("message",
SoapException.ServerFaultCode);
When I catch the exception in my application:
try
{
// Calling a method in my webservice
}
catch (Exception e)
{
// do something based on e.Message
}
When I get the e.Message it contains more information
than I provided in the throw-statement (theres
information about the webservice-method that throw the
exception)
The consequense is that my application can't react to the
exception without some work on the string. That's not
optimal.
When throwing the exception from the webservice I have an
user-defined exception. Is there
a way to send it through the SoapException for a nice
catch in the application ?
René