Hi People,
As most people are aware when you use a webservice and an error is thrown, the error is extracted and then bundled into a field on the SoapException. Which means you cant use try..catches to catch specific error messages.
eg:
Web Service side:
[WebMethod]
public void ThrowTestException()
{
throw new DivideByZeroException();
}
Client Side:
public void TestWebService()
{
webService service = new webService()
try
{
service.ThrowTestException();
}
catch(DivideByZeroException Ex)
{
// Never gets here.
}
catch(SoapException Ex)
{
// Goes here.
}
}
How are other people dealing with this? any tips of tricks? idealy I would like the proper exception on the client side, but I suspect that would break the abillity to interface with non dot net applications.
Thanks!
A