I am trying to built a WCF Service that can send only some Kb's of data.
In my Service there is a method which returning the 11500 Array object to client but I want to return only 500 Array or only 500KB data at a time.
I tried to use maxStringContentLength, maxArrayLength, maxBytesPerRead, maxNameTableCharCount but no change while returning the data, It's the same 11500 Array returning.
My WCF Web.config is like this
<bindings>
<wsHttpBinding>
<binding name="TestBinding" maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" receiveTimeout="00:25:00">
<!--<readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />-->
<readerQuotas maxStringContentLength="500" maxArrayLength="500" maxBytesPerRead="500" maxNameTableCharCount="500" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
Now I have two Quetions
1- How to limit the size of data
2- How to check the size of data on client side. How many Kb I'll receive.
I think I'll clear my questions, Please Help
EDIT 2:
<behaviors>
<endpointBehaviors>
<behavior name="endpointBehavior">
<webHttp helpEnabled="true" defaultOutgoingResponseFormat="Xml" faultExceptionEnabled="true" />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="STaCS">
<serviceMetadata httpGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
</serviceBehaviors>
</behaviors>