C#WCF客户端错误

问题描述:

我试图调用WCF web服务函数来发送数据和我收到波纹管例外C#WCF客户端错误

System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs. 

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) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at sgsGemma.WUI.WebServiceOnDemand.WebService.IDataSync.UpdateProductCategoryAssociations(String ProductId, String Outline, Boolean isFirstCall) 
    at sgsGemma.WUI.WebServiceOnDemand.WebService.DataSyncClient.UpdateProductCategoryAssociations(String ProductId, String Outline, Boolean isFirstCall) in C:\antg\Addins\Gemma\Baseline\Sources\WinForms\sgsGemma.WUI.WebServiceOnDemand\sgsGemma.WUI.WebServiceOnDemand\Service References\WebService\Reference.cs:line 150 
    at sgsGemma.WUI.WebServiceOnDemand.sgsgmWebServiceOnDemandF.SendItemCategoryAssociationsToWebService() in C:\antg\Addins\Gemma\Baseline\Sources\WinForms\sgsGemma.WUI.WebServiceOnDemand\sgsGemma.WUI.WebServiceOnDemand\sgsgmWebServiceOnDemandF.cs:line 704 
15:29:32.80 Th1 Error sgsGemma.WUI.WebServiceOnDemand.sgsgmWebServiceOnDemandF SendItemCategoryAssociationsToWebService System.ServiceModel.FaultException: The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs. 

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) 

Exception rethrown at [0]: 
    at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    at sgsGemma.WUI.WebServiceOnDemand.WebService.IDataSync.UpdateProductCategoryAssociations(String ProductId, String Outline, Boolean isFirstCall) 
    at sgsGemma.WUI.WebServiceOnDemand.WebService.DataSyncClient.UpdateProductCategoryAssociations(String ProductId, String Outline, Boolean isFirstCall) in C:\antg\Addins\Gemma\Baseline\Sources\WinForms\sgsGemma.WUI.WebServiceOnDemand\sgsGemma.WUI.WebServiceOnDemand\Service References\WebService\Reference.cs:line 150 
    at sgsGemma.WUI.WebServiceOnDemand.sgsgmWebServiceOnDemandF.SendItemCategoryAssociationsToWebService() in C:\antg\Addins\Gemma\Baseline\Sources\WinForms\sgsGemma.WUI.WebServiceOnDemand\sgsGemma.WUI.WebServiceOnDemand\sgsgmWebServiceOnDemandF.cs:line 704 

我在相同的应用程序和同样的形式称为同一Web服务的其他功能,它工作正常。但这不是。

任何人都可以请向我解释什么意思这个例外,如何解决它? 谢谢

+0

您是否尝试打开跟踪并按错误消息中的建议打开并查找问题? – KSK

+0

我需要访问跟踪和日志 –

+2

这就是所有情况:_服务器由于内部错误而无法处理请求._错误位于服务器端。请咨询服务API可能发生的异常情况和/或咨询服务的所有者。 – Silvermind

在web服务端有一些例外。 可以调试webservice方法,也可以在webservice配置文件中设置IncludeExceptionDetailInFaults = true。

+0

是的你是对的。最后,我发现解决方案是Server端的一个例外 –