Detail property of SoapException set in .NET Web service ends up as null in Java web service client
So I wrote simple asmx .NET web service in C#. All exceptions are caught and re-thrown as SoapException with Detail property set up to XmlNode that contains three sub-nodes with additional information about exception that has occurred. On Java side server exceptions surface as SoapFaultException. But when I try to print ex.getFault().getDetail() it's appears to be null. So my question is why is this happening or what am I doing wrong?
Finally managed to get raw SOAP response:
HTTP/1.1 500 Internal Server Error
Cache-Control: private
Content-Type: text/xml; charset=utf-8
Server: Microsoft-IIS/7.0
X-AspNet-Version: 2.0.50727
X-Powered-By: ASP.NET
Date: Tue, 04 Oct 2011 20:13:21 GMT
Content-Length: 2143
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org /soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Server</faultcode>
<faultstring>System.Web.Services.Protocols.SoapException: ...</faultstring>
<faultactor>CustomSoapException</faultactor>
<detail>
<CustomExceptionType>BackendException</CustomExceptionType>
<UserMessage>Internal application error occured. Please contact application developer for quick resolution.</UserMessage>
<DeveloperMessage>Exception details: ....</DeveloperMessage>
</detail>
</soap:Fault>
</soap:Body>开发者_开发技巧
</soap:Envelope>
精彩评论