简体   繁体   English

WCF 服务正在返回无法理解的错误消息

[英]WCF Service is returning error message which is not understandable

From my Library project, I'm making a call to a WCF service, which returns the following error message.在我的库项目中,我正在调用 WCF 服务,该服务返回以下错误消息。 The strange thing is that the service does not create any log for this request.奇怪的是服务并没有为这个请求创建任何日志。

*Server stack trace: *服务器堆栈跟踪:

at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)在 System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) 在 System.ServiceModel.Channels。 ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels。 ServiceChannelProxy.Invoke(IMessage 消息)

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

at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at MLibrary.ValidationService.IValidation.DetectEx(Data data) at MLibrary.ValidationService.ValidationClient.DetectEx(Data data) at MLibrary.Validator.Change(Int32 duration, List`1 params)*在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 在 MLibrary.ValidationService.IValidation.DetectEx(Data data)在 MLibrary.ValidationService.ValidationClient.DetectEx(Data data) 在 MLibrary.Validator.Change(Int32 duration, List`1 params)*

In web.config added below lines of code.在 web.config 中添加了以下代码行。 Which will enable server stack trace and we can find the root cause of the issue.这将启用服务器堆栈跟踪,我们可以找到问题的根本原因。

<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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM