2014-04-03 246 views
1

我試圖調用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

回答

2

在web服務端有一些例外。 可以調試webservice方法,也可以在webservice配置文件中設置IncludeExceptionDetailInFaults = true。

+0

是的你是對的。最後,我發現解決方案是Server端的一個例外 –