Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Jeff Atwood posted <a href="http://www.codinghorror.com/blog/archives/000054.html" rel="nofollow noreferrer">an interesting aerticle</a> about this subject some time ago. Allthough a .NET exception is converted to a SoapFault, which is compatible with most other toolkits, the information in the faults isn't very good. Therefor, the conlusion of the article is that .NET webservices don't throw very good exception messages and you should add additional information:</p> <pre><code>Private Sub WebServiceExceptionHandler(ByVal ex As Exception) Dim ueh As New AspUnhandledExceptionHandler ueh.HandleException(ex) '-- Build the detail element of the SOAP fault. Dim doc As New System.Xml.XmlDocument Dim node As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ SoapException.DetailElementName.Name, _ SoapException.DetailElementName.Namespace) '-- append our error detail string to the SOAP detail element Dim details As System.Xml.XmlNode = doc.CreateNode(XmlNodeType.Element, _ "ExceptionInfo", _ SoapException.DetailElementName.Namespace) details.InnerText = ueh.ExceptionToString(ex) node.AppendChild(details) '-- re-throw the exception so we can package additional info Throw New SoapException("Unhandled Exception: " &amp; ex.Message, _ SoapException.ClientFaultCode, _ Context.Request.Url.ToString, node) End Sub </code></pre> <p>More info why soapfaults are better <a href="https://stackoverflow.com/questions/81306/wcf-faults-exceptions-versus-messages">in this question</a>.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload