【发布时间】:2018-02-02 15:36:21
【问题描述】:
我在 .NET 中使用服务引用来调用第三方运营商 API,即 ESTES。您可以找到 wsdl here。现在,每当我从代码中调用它并且出现一些错误时,它只会抛出一个 FaultException 和异常消息作为 GeneralErrorMsg 或 SchemavalidationError,而没有任何有意义的消息。当我在 SOAP UI 工具中运行它而不是从 .Net 代码中运行它时,我确实收到了有意义的消息。
以下是一些异常图像的链接。仅供参考,内部异常为空
以下是我使用 SOAPUI 运行 API 时得到的响应。仅供参考,这是第三方 API,不是我们的,我只是在调用他们的 API
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>GeneralErrorMsg</faultstring>
<detail>
<bol:generalError xmlns:bol="http://ws.estesexpress.com/bol">
<bol:error>
<bol:code>BOL0193</bol:code>
<bol:message>We cannot automatically assign a PRO number if the shipping address is not serviced directly by Estes. Please uncheck the "Assign PRO #" box. Questions? Feel free to call your <a href="/WebApp/TerminalList/"> local terminal</a>.</bol:message>
</bol:error>
<bol:error>
<bol:code>BOL0101</bol:code>
<bol:message>Invalid state/zip combination</bol:message>
</bol:error>
</bol:generalError>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
请帮帮我,这真的让我很难过。
【问题讨论】:
-
你能解决这个问题吗?我也有同样的问题。
标签: c# .net service-reference faultexception