【问题标题】:WCF Service is returning error message which is not understandableWCF 服务返回无法理解的错误消息
【发布时间】:2018-12-08 06:27:23
【问题描述】:

从我的库项目中,我正在调用 WCF 服务,该服务返回以下错误消息。奇怪的是服务没有为这个请求创建任何日志。

*服务器堆栈跟踪:

在 System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(消息 回复、MessageFault 故障、字符串操作、MessageVersion 版本、 故障转换器故障转换器)在 System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime 操作,ProxyRpc& rpc) 在 System.ServiceModel.Channels.ServiceChannel.Call(字符串动作, Boolean oneway, ProxyOperationRuntime 操作, Object[] ins, Object[] 出局,TimeSpan 超时)在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime 操作)在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage 留言)

在 [0] 处重新抛出异常:

在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,IMessage retMsg)在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(消息数据& msgData,Int32 类型)在 MLibrary.ValidationService.IValidation.DetectEx(数据数据)在 MLibrary.ValidationService.ValidationClient.DetectEx(数据数据)在 MLibrary.Validator.Change(Int32 duration, List`1 params)*

【问题讨论】:

  • 你尝试过 WCF 跟踪了吗?
  • 是的,之后我得到了服务器堆栈跟踪部分

标签: c# wcf


【解决方案1】:

在 web.config 中添加以下代码行。这将启用服务器堆栈跟踪,我们可以找到问题的根本原因。

<configuration> 
<system.diagnostics> 
    <sources> 
            <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
            <listeners>
            <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "c:\log\Traces.svclog" />
            </listeners> 
        </source> 
    </sources>
</system.diagnostics>

【讨论】:

    猜你喜欢
    • 2010-10-17
    • 2020-09-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多