Question : WCF error while receving large amout of data

I have a WCF service hosted in a windows service.
It works well for getting 2000 rows of data each row is an object which could have nested objects.
Once the fetch crosses 2200 or so rows I get the following error
An error occurred while receiving the HTTP response to http://blah blalblah. This could be due to the service endpoint binding not using the HTTP protocol. This could also be due to an HTTP request context being aborted by the server (possibly due to the service shutting down). See server logs for more details
."System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive.
The underlying connection was closed: An unexpected error occurred on a receive. System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

I am using the folllowing configuration on the client side configuration
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
	<system.serviceModel>
		<bindings>
			<basicHttpBinding>
				<binding name="BasicHttpBinding_IErrorsService" closeTimeout="10:01:00" 
                    openTimeout="10:01:00" receiveTimeout="10:10:00" sendTimeout="10:01:00"
                    allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                    maxBufferSize="2147483647" maxBufferPoolSize="5147483647" maxReceivedMessageSize="2147483647"
                    messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                    useDefaultWebProxy="true">
					<readerQuotas maxDepth="2000000"  maxStringContentLength="2147483647" 
            maxArrayLength="2147483647" maxBytesPerRead="2000000"  maxNameTableCharCount="2147483647" />
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Ntlm" proxyCredentialType="None" realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
				</binding>
			</basicHttpBinding>
		</bindings>
		<client>
			<endpoint address="http://localhost:8082/blah blah/SomeService/" behaviorConfiguration="SomeServiceBehavior"
                binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IErrorsService"
                contract="ErrorsService.IErrorsService" name="BasicHttpBinding_IErrorsService">      
        <identity>
          <userPrincipalName value="XYZ\XYZ" />
        </identity>
        </endpoint> 
		</client>
		<behaviors>
			<endpointBehaviors>
				<behavior name="SomeServiceBehavior" >
					<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
				</behavior>
			</endpointBehaviors>
		</behaviors>
	</system.serviceModel>
 
</configuration>

Answer : WCF error while receving large amout of data

try placing the same code in the current event of the form


Private Sub Form_Current()
    Select Case Me.cboWorkCategory.Column(1)
        Case "CLIENT RATES", "PHARMACY RATES", "COPAY", "ADVANTAGE 90", "DAW", "ACCUMULATIONS", "NEW PLAN - COPIED/TEMPLATE", "PANELS", "NEW PLAN", "SPECIALTY", "NON-ELIGIBILITY PLAN"
            Me.ROUTING_MCO_FIFO.Controls("cboMCOClaimsMonitor").Enabled = True
            Me.ROUTING_COMMERCIAL_FIFO.Controls("cboCOMClaimsMonitor").Enabled = True
        Case Else
            Me.ROUTING_MCO_FIFO.Controls("cboMCOClaimsMonitor").Enabled = False
            Me.ROUTING_COMMERCIAL_FIFO.Controls("cboCOMClaimsMonitor").Enabled = False
             
    End Select
End Sub
Random Solutions  
 
programming4us programming4us