.net - Catching SoapExceptions from ASP.net Webservices -
I have a Windows Forms client that uses an ASP.NET web service.
It is my understanding that when an exception is thrown by the web service, it will be converted to a soap expense in the net client software.
OK, I'm catching a soap off, but when I display the message at the end of the client's message box, it actually shows as much information as possible to show me
Here is a webservice code:
throw a new applicationException ("Invalid user name or password."); Or even:
Throw new soap expansions ("Invalid user name or password.", Soapexation. Serverfalcoded); But at the client end, the message property of the simplicity is:
System.Web.Services.Protocols.SoapException: Invalid user name or password transport.Instert sign- C: \ Documents and Settings \ rdoverby \ My Documents \ Visual Studio 2008 \ WebSite \ www.gtcc.edu \ App_Code \ webservices \ Transportation.cs: Row 50 in the UPS (String Username, String Password, Signup [] Signups) Pre>However, I really want to show it:
Invalid user name or password.How can I remove the message of only the original exception from Soap Exclusion? I VS The soap exception in the debugger is poked around the object, but I can not find what I see.
Thank you.
Edit
Of course, I do not want to parse that long string.
exception is a soap exception (from) so you can do something like se.Detail.FirstChild.OuterXml Using the most important bits can be obtained, where exceptions are usually kept or if you want much more then SE.Detail.OuterXml
Comments
Post a Comment