【发布时间】:2015-08-14 08:54:31
【问题描述】:
尝试将 includeExceptionDetailInFaults="true" 添加到我正在调用的 Web 服务的 Web 配置中,但我定义的两种行为都不起作用。
这是我调用网络服务时遇到的错误:
System.ServiceModel.FaultException:服务器无法处理 由于内部错误导致的请求。有关更多信息 错误,要么打开 IncludeExceptionDetailInFaults(要么来自 ServiceBehaviorAttribute 或从配置行为)上 服务器为了将异常信息发送回客户端, 或根据 Microsoft .NET Framework 3.0 SDK 打开跟踪 文档并检查服务器跟踪日志。
<behaviors>
<serviceBehaviors>
<behavior name="debug">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<!--<behaviors>
<endpointBehaviors>
<behavior name="debug">
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</endpointBehaviors>
</behaviors>-->
<client>
<endpoint address="..."
binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICommunicationService"
behaviorConfiguration="debug"
contract="CommunicationServiceReference.ICommunicationService"
name="WSHttpBinding_ICommunicationService" />
</client>
编辑: 我看了这个类似的问题,但在建议的答案中有
<services>
<service...
在我的情况下是
<client>
<endpoint
我也尝试更改为services,但没有成功
【问题讨论】:
标签: web-services exception web-config