EDIT: I have scoured high and low for an answer to this and nobody seems to be getting a similar issue. It seems to me that throwing the SoapException
should fo
Your code should work and give you a formatted fault as per the MSDN example or, if you want a result as in the response sample you posted, then a service like this should do the trick:
Imports System
Imports System.Web.Services
Imports System.Web.Services.Protocols
Imports System.ComponentModel
Imports System.Xml.Serialization
Imports System.Xml
_
_
_
Public Class Service1
Inherits WebService
Public Sub Process()
Dim detailsNode As XmlNode = Nothing
Dim actorString As String = Nothing
Throw New SoapException("BlahBlahBlahBlahBlah", SoapException.ServerFaultCode, actorString, detailsNode)
End Sub
End Class
A call like this:
should return this:
soap:Server
BlahBlahBlahBlahBlah
You also need to add this to your Web.config
file to remove any stacktrace in your fault string:
...
...
...
Also, it's usually not necessary to build the SoapException by hand but throw more appropriate exceptions and let ASP.NET wrap it in a SoapFault. See here for more details: Using SOAP faults.
Use SoapUI to call your method and you should get the above result. Make sure you make a POST on the SOAP endpoint e.g. http://localhost:8080/Service1.asmx
and not on the URL of the test page when you click "Invoke" e.g. http://localhost:8080/Service1.asmx/Process
as that does not return SOAP formatted responses.