Search code examples
.netserviceasmx

Soap Exception message returns two different error messages from two different servers for the same asmx service


We have an ASMX service and the same code deployed in two different servers but whenever there is an exception or error happening in one server the exception message returned is different for both servers.Specifically the fault string is different.Below are the sample messages returned on an error from both servers

Message from First Server

The remote server returned an error: (500) Internal Server Error.
SOAP Response: 

<?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:Client</faultcode>
      <faultstring>Fault occurred</faultstring>
      <faultactor>http://bbbonline.consumerservice/service.asmx?op=FileComplaint</faultactor>
      <detail>ErrorOccured at so and so..</detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

Message from Second Server

The remote server returned an error: (500) Internal Server Error.
SOAP Response: 
<?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:Client</faultcode>
      <faultstring>
        System.Web.Services.Protocols.SoapException: Fault occurred
        at BBBOnline.Application.MyService.MySoapException(XmlNode ErrorNode)
        at BBBOnline.Application.MyService.FileAComplaint(String SSN, String Buisness, String Issue, String Reason, String date)
      </faultstring>
      <faultactor>http://bbbonline.consumerservices/service.asmx?op=FileComplaint</faultactor>
      <detail>ErrorOccured..</detail>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>

In both the messages above the FaultString is different,but the code in both servers is absolutely same.


Solution

  • This problem is typically caused by differences in the web.config files on the two servers. In particular, look to see if the <customErrors> elements are different.

    If the web.configs are identical, look for differences in the machine.config files on the two servers.