我们在两台不同的服务器上部署了一个 ASMX 服务和相同的代码,但是每当一台服务器发生异常或错误时,两台服务器返回的异常消息都是不同的。特别是故障字符串不同。以下是返回的示例消息来自两台服务器的错误
来自第一台服务器的消息
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>
来自第二个服务器的消息
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>
在上面的两个消息中,FaultString 是不同的,但是两个服务器中的代码是完全一样的。