Zag Gol
Zag Gol

Reputation: 1076

Cant send large data to WCF server

i am failing sending large data to wcf server, despite i configured it.

sending small data works ok.

the data is a TimeSpan, GUID, int, bool, string. when the string.Length is larger then about 45000 - it fails

in my server config:

  <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_IWcfService" 
                     maxBufferSize="1048576000"
                     maxBufferPoolSize="524288000"
                     maxReceivedMessageSize="1048576000">
                    <readerQuotas maxDepth="2147483647"
                             maxStringContentLength="2147483647"
                             maxArrayLength="2147483647" 
                             maxBytesPerRead="2147483647"
                             maxNameTableCharCount="2147483647" />
           </binding>
        </basicHttpBinding>
    </bindings>   


 <services>
        <service name="Receiver.StorageHandlerService">
            <endpoint address="" binding="basicHttpBinding" contract="Receiver.ISorageHandlerService">
                <identity>
                    <dns value="localhost"/>
                </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
            <host>
                <baseAddresses>
                    <add baseAddress="http://99.99.99.99:8733/Design_Time_Addresses/Receiver/StorageHandlerService/"/>
                </baseAddresses>
            </host>
        </service>
    </services>

in my client config:

bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_ISorageHandlerService" 

                     maxBufferSize="1048576000"
                     maxBufferPoolSize="524288000"
                     maxReceivedMessageSize="1048576000">
                    <readerQuotas maxDepth="2147483647"
                             maxStringContentLength="2147483647"
                             maxArrayLength="2147483647" 
                             maxBytesPerRead="2147483647"
                             maxNameTableCharCount="2147483647" />
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="http://99.99.99.99:8733/Design_Time_Addresses/Receiver/StorageHandlerService/"
            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ISorageHandlerService"
            contract="ServiceData.ISorageHandlerService" name="BasicHttpBinding_ISorageHandlerService" />
    </client>

thanks!

Upvotes: 0

Views: 84

Answers (1)

Tim
Tim

Reputation: 28520

While you have configured a binding with larger than default values in your service configuration, it's not being used because it's not assigned to an endpoint. To assign the binding configuration you've specified, you need to use the bindingCongfiguration attribute on the endpoint element in your service configuration (similar to the way the client configuration is set up), like this:

<services>
    <service name="Receiver.StorageHandlerService">
        <endpoint address="" binding="basicHttpBinding" 
                  bindingConfiguration="BasicHttpBinding_IWcfService"
                  contract="Receiver.ISorageHandlerService">

Your configuration as posted did not specify a configuration for the basicHttpBinding, so a default instance of BasicHttpBinding is used, with the default values for the various settings.

Upvotes: 1

Related Questions