2009-03-24 7 views
0

複雑なオブジェクト(入れ子になったオブジェクトを持つオブジェクトが入れ子になったオブジェクト..)を返そうとしたときに、シリアライゼーションやサイジングの問題があると思います。WCF Sericeから複雑なオブジェクトを返す方法は?

エラーコードには、CommunicationExceptionがあります。何か案が?

EDIT:これは、問題はおそらくタイプの複雑さとは関係ありませんスタックトレース

A first chance exception of type 'System.ServiceModel.CommunicationException' occurred in mscorlib.dll 
System.ServiceModel.CommunicationException: Connessione sottostante chiusa: Chiusura imprevista della connessione.. ---> System.Net.WebException: Connessione sottostante chiusa: Chiusura imprevista della connessione.. 
    in System.Net.HttpWebRequest.GetResponse() 
    in System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
    --- Fine dell'analisi dello stack dell'eccezione interna --- 

Server stack trace: 
    in System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebException(WebException webException, HttpWebRequest request, HttpAbortReason abortReason) 
    in System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) 
    in System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) 
    in System.ServiceModel.Channels.ClientReliableChannelBinder`1.RequestClientReliableChannelBinder`1.OnRequest(TRequestChannel channel, Message message, TimeSpan timeout, MaskingMode maskingMode) 
    in System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode) 
    in System.ServiceModel.Channels.ClientReliableChannelBinder`1.Request(Message message, TimeSpan timeout) 
    in System.ServiceModel.Security.SecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(Message message, TimeSpan timeout) 
    in System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) 
    in System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) 
    in System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) 
    in System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) 
    in System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) 

Exception rethrown at [0]: 
    in System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 
    in System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) 
    in RecuperoPagati.DataCoreReference.IDataCoreService.GetDossierByNumDossier(String Env, String NumDossier) 
    in RecuperoPagati.DataCoreReference.DataCoreServiceClient.GetDossierByNumDossier(String Env, String NumDossier) in C:\Documents and Settings\gdipietro\Documenti\Dev\Rifatturazione\RecuperoPagati\RecuperoPagati\RecuperoPagati\Service References\DataCoreReference\Reference.vb:riga 198 
    in RecuperoPagati.WebUserControl1.Page_Load(Object sender, EventArgs e) in C:\Documents and Settings\gdipietro\Documenti\Dev\Rifatturazione\RecuperoPagati\RecuperoPagati\RecuperoPagati\WebUserControl1.ascx.vb:riga 8 

答えて

0

です。すべてのInnerExceptionを含む完全な例外を投稿してください。例外をキャッチしてex.ToString()を送信してください。

1

私はJohnに同意します。おそらくタイプの複雑さの問題ではないでしょう。真の犯人を吐き出すために、診断ログをサービス設定に追加することができます。 WCFのトレース機能とログ機能は非常に強力で、ほとんどの問題の根本原因を見つけるのに役立ちます。

VS2008を実行している場合、サービスホストプロジェクトの設定ファイルを右クリックすると、「Edit WCF Configuration」のメニューオプションが表示されます。トレースとメッセージロギングを有効にするには、[診断]ノードを選択します。

http://msdn.microsoft.com/en-us/library/ms730064.aspx

このログからの出力は、すでにマシン上になければなりませんサービストレースビューアツール、(フレームワークが付属しています)には非常に効果的に表示することができます。

http://msdn.microsoft.com/en-us/library/ms732023.aspx

関連する問題