Pierre Greborio.NET

Talking about .NET world

SOAP faults on WSDL

Soap Faults are an important way to communicate to the consumer (SOAP Node) that something goes wrong.  For each operation we can associate more than one fault message (0..N). Today (and probably on Visual Studio .Net 2005 too) we can't define the soap:fault content (message) to generate into the WSDL document from the code.

I hope (someday) to have some attribute (SoapFaultAttrinbute ?) that permits to define which soap fault to use in some circumstances. Is it a so bad idea ?

Posted: Nov 25 2004, 05:08 PM by PierreG | with 2 comment(s)
Filed under:

Comments

Jan Tielens said:

We can do this today as well! This article goes into detail:
http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/soapexceptions.mspx

Summary:

Sometimes things can go wrong when code is executed, so Exceptions are thrown. When your application exposes services through a webservice layer, SoapExceptions are thrown from the server to the client. By default normal Exceptions are converted to a SoapException, resulting in a rather ugly Exception containing all information concatenated in a long String. But luckily the SOAP protocol allows any XML document to be included in SOAP error messages. This article shows how to build some helper classes to easily pass error information from the server to the client through a webservice layer.
# November 25, 2004 1:59 PM

Pierre Greborio said:

Thanks Jan,
but your article explain how wrap the soap fault (exception) easly. What I mean is how to (easly) reflect a soap fault to the WSDL document with the standard ASP.NET WSDL generator.
# November 25, 2004 4:25 PM