views:

68

answers:

2

Hi,

What's the limit of data that I can return by WCF service? I tried to play around with maxReceivedMessageSize and other parameters but still dont know what exactly the limit? Even if I get rid of "size quota for incoming messages" issue I get "an existing connection was forcibly closed by the remote host".

I know that "pagging" is the best solution but at the moment I want to know what's MAX of data I can send to the client without additional complexity. Thanks!

Regards, Leonid

A: 

There are a lot of settings that influence the amount of data you can send/receive before limits are exceeded.

  • The service binding's maxReceivedMessageSize setting;
  • The service binding's maxStringContentLength setting;
  • The service binding's maxArrayLength setting;
  • The service behavior's maxItemsInObjectGraph setting.

And, if you're hosting in IIS:

  • ASP.NET's maxRequestLength;
  • IIS' maxAllowedContentLength (under security/requestFiltering/requestLimits).
ErikHeemskerk
just find an article: http://blogs.msdn.com/b/drnick/archive/2006/11/14/how-to-configure-maxitemsinobjectgraph.aspxthat helps me a lot. now I can upload to the client side xml over 11M
Leonid
+1  A: 

There are two places you have to edit: check this http://forums.silverlight.net/forums/t/40770.aspx

  1. edit the ServiceReferences.ClientConfig to accept a large buffer.

    binding name="BasicHttpBinding_MosaicService" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">

  2. on the server in the web.config

add a Httpbinding and name it

which setts it to 2MB and tell the service to use this binding

<services>

     <service behaviorConfiguration="TekPlayground.MosaicServiceBehavior"
name="TekPlayground.MosaicService">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="ServicesBinding" contract="TekPlayground.MosaicService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

Space Cracker