Is there some way I can raise a true SOAP Fault? What I mean is, currently, I
am throwing an exception and letting IIS take care of sending the SOAP Fault.
This works but I would like to control the actual Fault message that is sent
back. For example I would like to change the faultcode and faultstring.
I would like to do this from a web method as well as from within the filter
pipeline.
alex bean - 13 May 2005 19:45 GMT
I'm getting a little closer but I still don't complete control.
I found the System.Web.Services.Protocols.SoapException class.
This works well in a web method. But when I raise one from within a custom
filter extra stuff is added.
Here is how I raise it:
throw new System.Web.Services.Protocols.SoapException
("Filter message",
new System.Xml.XmlQualifiedName("name","http://namespace"));
And here is what I get in the fault:
System.Web.Services.Protocols.SoapException: Filter message
at MyWSCustomFilter.MyWSCF.ProcessMessage(SoapEnvelope envelope) in
c:\documents and settings\abean\my documents\visual studio projects\
customfilterws\mywscustomfilter\class1.cs:line 24
at Microsoft.Web.Services2.Pipeline.ProcessInputMessage(SoapEnvelope
envelope)
at
Microsoft.Web.Services2.WebServicesExtension.BeforeDeserializeServer(SoapServerMessage message)
How do I get rid of all the extra stuff.