Friday 16 August 2013

The underlying connection was closed: An unexpected error occurred on receive.


ERROR:-Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.

The underlying connection was closed: An unexpected error occurred on receive.

To solve the above error we have to add the below configuration in endpoint behavior or service behavior.

       <dataContractSerializer maxItemsInObjectGraph="6553600" />

If above configuration does not solve the issue there is problem with ResponseFormat json.
Just set the ResponseFormat to XML it will work without error.


If you have DateTime type in your class  set the some Date other than default [{01-01-0001 00:00:00}] . It solve the problem. It is problem with json ,it works well with XML.

No comments:

Post a Comment