Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

An existing connection was forcibly closed by the remote host - WCF

Tags:

wcf

I have a WCF web service that is working fine. However there is one particular call that is failing - but only failing for certain users. The call is pretty simple - it is a call to get a list of Person objects.

For User A it works fine. The service queries the database, creates the list of Person objects and returns it back to the calling application.

For User B it fails. The weird thing is that when I do debugging the service seems to work fine. It is able to query the database and it creates the List object and returns it. The service itself never fails. But the client application receives the "An existing connection was forcibly closed by the remote host" error.

To me it seems like something is happening when the service layer is trying to package up the data in XML format to send back to the calling application. I am thinking that it has to be a data related problem because the call works fine for other users. I have visually looked at the data and I don't really see anything odd. One guess is that the data for User B has some funky hidden characters or something and therefore is causing the service to close unexpectedly. Something like that.

Any ideas?

like image 674
Corey Burnett Avatar asked Aug 26 '11 19:08

Corey Burnett


1 Answers

The best thing I've found for diagnosing things like this is the service trace viewer. It's pretty simple to set up (assuming you can edit the configs):

http://msdn.microsoft.com/en-us/library/ms732023.aspx

Hope this helps.

like image 79
NateTheGreat Avatar answered Oct 09 '22 15:10

NateTheGreat