Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
We have property to set the Size of Receiving(Incoming) message data "maxReceivedMessageSize="65536"" property in wcf configuration , but i want to set the size of Sending(outgoing) Message in wcf. Wich property will do this action.


Thanks in Advance
Posted
Updated 18-Jul-11 3:38am
v2

You are probably looking for the readerQuotas[^] element
<readerQuotas maxStringContentLength="65536000" maxArrayLength="65536000" maxBytesPerRead="65536000" />



[Update]

This usually does the trick:
XML
<system.serviceModel>
  <client>
    <endpoint name="DataService" address="net.tcp://localhost:34433/DataService"
       binding="netTcpBinding" bindingConfiguration="DataServiceBinding"
       contract="xx.xx.xx.Client.DataService" behaviorConfiguration="DataServiceBehavior" />
  </client>
  <behaviors>
    <endpointBehaviors>
      <behavior name="DataServiceBehavior">
        <dataContractSerializer maxItemsInObjectGraph="65536000" />
      </behavior>
    </endpointBehaviors>
  </behaviors>
  <bindings>
    <netTcpBinding>
      <binding name="DataServiceBinding" sendTimeout="00:05:00"
             maxBufferPoolSize="655360000" maxBufferSize="65536000"
             maxReceivedMessageSize="65536000">
        <reliableSession ordered="true" enabled="true" />
        <security mode="Transport">
          <transport clientCredentialType="Windows" />
        </security>
        <readerQuotas maxStringContentLength="65536000" maxArrayLength="65536000"
             maxBytesPerRead="65536000" />
      </binding>
    </netTcpBinding>
  </bindings>
</system.serviceModel>


Best regards
Espen Harlinn
 
Share this answer
 
v2
Comments
basheer971 19-Jul-11 5:06am    
Thanks for reply.This is really good solution, but with this i am not able to restrict the client messages(Request) size in my service. is there any more idea.
I got the answer and i like to share it, we can limit the out going Message Size.
1. "maxReceivedMessageSize"-Limit the Service message
2."maxRequestLength"- Limiting the client message size.


"maxReceivedMessageSize"-declaring in Client App.config

"maxRequestLength"-declaring in service web.config

See the James Osborne - MSFT & Utkarsh Shah answers,

http://social.msdn.microsoft.com/forums/en-us/wcf/thread/9567591D-D115-4263-9FBD-B1593524C1C4[^]
 
Share this answer
 
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900