locked
Size limit of WCF request? RRS feed

  • Question

  • Hi,

    I have a scenario where a server app should communicate with a client app through wcf. The server needs to be able to notify the client and transmit some data over to the client side. Due to external constraints we cannot use the callback functionality of wcf. Therefore the client is setup as a selfhosted wcf service that exposes functions that the server application can use for notifications and for transmitting the data over to the client.

    This is the interface of the client application
    ICallbackService
    void OnDataNotification(string serverID)
    void TransmitData(string data)
    


    Here is my problem. The notification mechanism is working fine, but when the server is trying to transmit the data over to the client I seem to reach a size limitations for the request. The data to be sent is an xml document that contains around 20 000 characters.

    The server application is a wcf service hosted in IIS. The client application is a self hosted wcf service. Both the server and the client uses a basicHttpBinding for the communication.

    Here is the app.config for the server app

       <binding name="BasicHttpBinding_ICallbackService" closeTimeout="00:01:00"
         openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
         allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
         maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
         messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
         useDefaultWebProxy="true">
         <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
          maxBytesPerRead="4096" maxNameTableCharCount="16384" />
         <security mode="None">
          <transport clientCredentialType="None" proxyCredentialType="None"
           realm="">       
          </transport>
          <message clientCredentialType="UserName" algorithmSuite="Default" />
         </security>
        </binding>
    Here is the app.config for the client
                    <binding name="BasicHttpBinding_IDataService" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                        useDefaultWebProxy="true">
                        <readerQuotas maxDepth="32" maxStringContentLength="5242880" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <security mode="None">
                            <transport clientCredentialType="None" proxyCredentialType="None"
                                realm="">                            
                            </transport>
                            <message clientCredentialType="UserName" algorithmSuite="Default" />
                        </security>
                    </binding>
    Are there some other places where you can increase the default size limit of the the request from the server to the client? Or should I use a different approach for the xml data transmission from the server to the client?

    Any advice and input would be highly appreciated.

    Best regards

    Hakan
    Friday, December 4, 2009 3:10 PM

Answers

All replies