0
votes

I am using WCF service with dynamic proxy creation on static IP. Url = "http://" + staticIP + "/CM.svc"

BasicHttpBinding binding = new BasicHttpBinding();

Also have set binding.MaxReceivedMessageSize = 2147483647; Maxbuffersize, MaxbufferPoolsize, Receivetimeout, Opentimeout, closetimeout, sendtimeout, transferMode...

EndpointAddress endpoint = new EndpointAddress(Url);
ChannelFactory<ICMOnlineApp> factory = new ChannelFactory<ICmOnlineApp>(binding, endpoint);

foreach(var operation in factory.Endpoint.Contract.Operations)
{
operation.Behaviors.find<DataContractSerializerOperationBehavior>().DataContractResolver = new DynamicTypeResolver();

 ICMOnlineApp proxy = factory.CreateChannel();

return proxy;

}

Also i have done all settings in web.config file of WCF service.

Still i am getting this error. Please guide.

2
What is your client actually sending to the service? have you checked what is going to the wire? You can use wireshark, tcpmon or enable the WCF tracing for this.Juan
i am sending about 21 parameters to webservice. Includes 10 datatable, 1 dataset, 1 hashtable and other string / decimal parameters. i have enabled WCF tracing. it gives me "The maximum message size quota for incoming messages(65536) has been exceedec. To increase the quota use the MaxReceivedMessageSize property on the appropriate binding element.Jaykishan
Have you set the properties in BOTH the client and the server?Juan

2 Answers

0
votes

For the error shown in the WCF traces looks like the service you are sending the message to doesn't allow that size of message.

"The maximum message size quota for incoming messages(65536) has been exceed"

Change the configuration of the WCF service, and the client, to allow messages of that size:

<bindings>
    <basicHttpBinding>
        <binding name="basicHttp" allowCookies="true"
                 maxReceivedMessageSize="2147483647" 
                 maxBufferSize="2147483647"
                 maxBufferPoolSize="2147483647">
            <readerQuotas maxDepth="32" 
                 maxArrayLength="2147483647"
                 maxStringContentLength="2147483647"/>
        </binding>
    </basicHttpBinding>
</bindings>
0
votes

Try with the following configuration in the web.config and in the class:

Web.config:

<binding name="BasicBinding" maxReceivedMessageSize="2147483647" receiveTimeout="00:01:00" sendTimeout="00:01:00"
          <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
        </binding>

Code:

BasicHttpBinding binding = new BasicHttpBinding();
binding.MaxReceivedMessageSize = int.MaxValue;