Remove WCF-Service response size limit

I created a WCF service that starts an operation on a W2008 server and returns a data structure as a result. The problem is that this result may be larger than the standard service configuration. So I tried to increase (or remove) this maximum size, but it seems I did not find the correct properties.

In App.config WCF, I changed the following values ​​of my basicHttpBinding:

  • MaxBufferPoolSize → 6553600
  • MaxBufferSize → 6553600
  • MaxReceiveMessageSize → 6553600

ReaderQuotas:

  • MaxArrayLenght → 0
  • MaxBytesPerRead → 0
  • MaxDepth → 0
  • MaxNameTableCharCount → 0
  • MaxStringContentLength → 0

WCF-Testclient . , basicHttpBinding . , , . , ( ):

http- http://localhost:8731/Design_Time_Addresses/DiscoDataSource/Service1/. : Endpointbinding HTTP-, HTTP- .

:

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.Dispatcher.RequestChannelBinder.Request( , - TimeSpan)

System.ServiceModel.Channels.ServiceChannel.Call( String, Boolean oneway, ProxyOperationRuntime, Object [] ins, Object [] outs, - TimeSpan)

System.ServiceModel.Channels.ServiceChannel.Call( String, Boolean oneway, ProxyOperationRuntime, Object [] ins, Object [] outs)

System.ServiceModel.Channels.ServiceChannelProxy.InvokeService( IMethodCallMessageCall, ProxyOperationRuntime)

System.ServiceModel.Channels.ServiceChannelProxy.Invoke( )

. - , ?

,

+3
2

, , WCF barf. , : maxItemsInObjectGraph. , , . snippit :

<system.serviceModel>
 <behaviors>
   <serviceBehaviors>
     <behavior name="ServiceBehavior">
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
     </behavior>
   </serviceBehaviors>
   <endpointBehaviors>
     <behavior name="ClientBehavior">
      <dataContractSerializer maxItemsInObjectGraph="2147483646"/>
     </behavior>
   </endpointBehaviors>
 </behaviors>
</system.serviceModel>

, , , maxItemsInObjectGraph .config.

+6

, ? - .

, ( ) "".

, , , . - - 60 - , , SendTimeout , .....

+2

Source: https://habr.com/ru/post/1725166/


All Articles