Leonid
Leonid

Reputation: 478

make the service return large amount of data

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

Upvotes: 2

Views: 340

Answers (2)

Amr Badawy
Amr Badawy

Reputation: 7673

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" />

Upvotes: 1

ErikHeemskerk
ErikHeemskerk

Reputation: 1701

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).

Upvotes: 0

Related Questions