Showing posts with label WCF. Show all posts
Showing posts with label WCF. Show all posts

Friday, 24 August 2012

The underlying connection was closed: The connection was closed unexpectedly.” While returning Data Table from WCF service.


I have changed my operation Contract to return Dataset Instead of Data Table
[OperationContract]
DataSet LoadBatchInformation(string Batch);

Thursday, 21 June 2012

WCF - Proxy

To enable proxy in wcf


Find Proxy Address
IE ->Tools->internet options->Connections->LAN Settings
Proxy Sever
Address:
Port:


<system.net>
    <defaultProxy  useDefaultCredentials="true">
      <proxy bypassonlocal="True" proxyaddress="http://[proxy address]:[proxy port]"/>
    </defaultProxy>

Monday, 11 June 2012

The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element.

I got this error
"The maximum message size quota for incoming messages (65536) has been exceeded. To increase the quota, use the MaxReceivedMessageSize property on the appropriate binding element."
when i received data from the server.
for this problem i set MaxReceivedMessageSize in my client side.


<wsHttpBinding>
    <binding name="test" closeTimeout="00:01:00" openTimeout="00:01:00"
     receiveTimeout="00:10:00" sendTimeout="00:01:00" bypassProxyOnLocal="false"
     transactionFlow="false" hostNameComparisonMode="StrongWildcard"
     maxBufferPoolSize="524288" maxReceivedMessageSize="2147483647" messageEncoding="Text"
     textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
(or)


WSHttpBinding binding = new WSHttpBinding();
            binding.MaxReceivedMessageSize = 2147483647;
            EndpointAddress endpointAddress = new EndpointAddress("http://localhost:59167/Service1.svc");
            ServiceReference1.Service1Client sc = new ServiceReference1.Service1Client(binding,endpointAddress);

Hope this helps.