howto get exception information from asp.net webservice, without try and catch

D

dan

hi ng.

i have a asp.net application which is client of an asp.net webservice.
now i want to configure a custom error page (in case the sewrvice throws an
exception)
that provides the soapexception detail property as text.
but when defined in web.config, the error page doesn't provide access to the
thrown exception anymore.
i think that i somehow have to enter the http pipeline to catch the error,
read the data and transfer to a error page. is this right?
but i have no cue where to begin and what excactly i have to look for.

what i have been reseaching was the soapextension class where it was
possible to intervene the incoming soap fault.
but i couldn't avoid the exception to get thrown.
(of course i do not want to set up a try-catch solution)

thank you very much for your help,
dan
 
B

Brock Allen

If your webservice is failing, then you shouldn't show a HTML page to the
user. Typically the client of your webservice is not a human, so passing
back HTML makes little sense. The SOAP protocol includes error handing with
SoapFaults, so you should let the web service framework map the error on
your side to the SoapFault back to the client.
 
D

dan

hi brock,

the webservices provides a fault message. and as my client is a dotnet
client (a asp.net website), a saopexception gets generated from this fault
message.
what i want to do is to provide some information from the
soapexception.Detail property (which is set on serviceside when the
exception occurs ) to a standard error side that is invoked when a
soapaexception occurs.

example:

serviceside:
definition of node

SoapException se = new SoapException("Concurrency
eroor",SoapException.ClientFaultCode,"",node);

throw se;


->i have to throw a soapexception because otherwise, i don't get information
about the exception on client side (inner exception property of
soapexception is null!)

clientside:
try....

catch(System.Web.Services.Protocols.SoapException ex)

{

System.Xml.XmlNode node=ex.Detail;

foreach(System.Xml.XmlNode nod in node.ChildNodes)

{

string s=nod.InnerText;

s="";

}



dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top