2012-01-16 12 views
0

WCF経由でWinFormsクライアントから大きなデータオブジェクトを転送しようとしています。大きなデータオブジェクトをWCFクライアント経由でWCFサーバーに転送

クライアントがサーバーからオブジェクトを取得しようとすると、転送は成功します。しかし、 クライアントがオブジェクトをサーバーに送信しようとすると、エラーが発生します!!

エラーがある:System.ServiceModel.Channels.HttpChannelUtilities.ProcessGetResponseWebExceptionで

(WebException webException、HttpWebRequestの要求、HttpAbortReason abortReason)
System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequestで.WaitForReply(TimeSpan タイムアウト)で System.ServiceModel.Channels.RequestChannel.Request(メッセージメッセージ、 TimeSpanタイムアウト)で System.ServiceModel.Channels.ClientReliableChannelBinde R 1.RequestClientReliableChannelBinder 1.OnRequest(TRequestChannel チャンネル、メッセージのメッセージ、のTimeSpanタイムアウト、MaskingMode maskingMode)
System.ServiceModel.Channels.ClientReliableChannelBinder 1.Request(Message message, TimeSpan timeout, MaskingMode maskingMode) at System.ServiceModel.Channels.ClientReliableChannelBinder 1.Request(メッセージ メッセージ、のTimeSpanタイムアウト)で System.ServiceModel.Securityました。 System.ServiceModel.Channels.ServiceChannel.CallでSystem.ServiceModel.Dispatcher.RequestChannelBinder.Request(メッセージ メッセージ、のTimeSpanタイムアウト)でSecuritySessionClientSettings`1.SecurityRequestSessionChannel.Request(メッセージ メッセージ、のTimeSpanタイムアウト)(文字列アクション、 Boolean oneway、ProxyOperationRuntimeオペレーション、Object [] ins、 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessageが メッセージ)

で System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCallで、ProxyOperationRuntime動作)でオブジェクト[]アウト、のTimeSpanタイムアウト)私は振る舞い属性DataContractSerializerを加えて、それを最大値に設定しようとします。転送は、サーバーからクライアントまでの一方通行のみです。もう一方の側で - クライアントからサーバーまでは動作しません!

ありがとうございました。

+3

例外のErrorMessageを含めることができますか? – regex

+2

クライアントとサーバーに設定を投稿できますか? – Rajesh

答えて

1

メッセージ

  • の最大サイズを制御するいくつかの設定がありますMaxBufferSizeの
  • MaxReceivedMessageSize
  • MaxStringContentLength

参照:に次のパラメータを追加http://geekswithblogs.net/niemguy/archive/2007/12/11/wcf-maxstringcontentlength-maxbuffersize-and-maxreceivedmessagesize.aspx

+0

この属性は既にWeb設定に含まれており、同じエラーが発生します – user556882

+1

サーバーまたはクライアント側にこの属性を含めましたか? –

2

てみてくださいあなたのweb.configファイル(vaあなたの場合はルーグ):

<behaviors> 
    <serviceBehaviors> 
     <behavior name=""> 
      <dataContractSerializer maxItemsInObjectGraph="6553600"/> 
     </behavior> 
    </serviceBehaviors> 
</behaviors> 

...  

<system.webServer> 
    <security> 
     <requestFiltering> 
      <requestLimits maxAllowedContentLength="512000000" /> 
     </requestFiltering> 
    </security> 
</system.webServer> 
+0

、msdn(http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.maxitemsinobjectgraph.aspxおよびhttp://msdn.microsoft.com/en-us/library/ms689462 (v = vs.90).aspx) 'maxItemsInObjectGraph'は' System.Int32'で、 'maxAllowedContentLength'は' System.UInt32'です –

+0

私はそれを試してみたのと同じエラーを投げます – user556882

関連する問題