繁体   English   中英

C#WCF客户端错误

[英]C# WCF Client error

我正在尝试调用WCF Web服务函数来发送数据,并且收到以下异常消息

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服务的其他功能,并且效果很好。 但这不是。

谁能向我解释这个异常的含义以及如何解决? 谢谢

Web服务方面存在一些例外。 调试webservice方法或在webservice配置文件中设置IncludeExceptionDetailInFaults = true。

暂无
暂无

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

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