0

I have a client and WCF service running..

When a client tried to talk to WCF (i.e. getting a result from WCF), it throws the exception below..

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:00:59.9062420'.

So, I did search on Google and found threads on Stackoverflow. I tried to increase the timeout on the client as below

<netTcpBinding>
        <binding name="ServiceEndpoint"
          receiveTimeout="00:10:00" sendTimeout="00:10:00" >
          <security mode="None" />
        </binding>
</netTcpBinding>

And then I got the following error:

The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:09:59.8593729'.

When I debug the WCF Service, it is actually not taking long at all. It immediately returns a result. (it only validates the log in information by querying the database and return it immediately). So, my guess is not related to timeout at all.. but I don't know how to resolve it..

Please help...

ShamirDaj
  • 51
  • 6
  • Enable the trace in wcf and watch for the traces file – Saravanan Mar 29 '15 at 09:12
  • Links to help you get started:https://msdn.microsoft.com/en-us/library/ms751526(v=vs.110).aspx and https://msdn.microsoft.com/en-us/library/aa702726(v=vs.110).aspx – Saravanan Mar 29 '15 at 09:14
  • After searching more, I found the following post. http://stackoverflow.com/questions/3441844/the-socket-connection-was-aborted-communicationexception I am referencing the Entity (generated by EF) directly in my client. Now, I need to add DataCotract attribute to the all entity generated by EF. But since those are auto-generated, what is the best way to do this? Manually create another layer (says Domain) and map it to the Entity generated by EF? – ShamirDaj Mar 29 '15 at 12:00
  • had you solved the issue, share with others – Saravanan Mar 29 '15 at 12:01
  • No..I haven't solved it yet.. I found this post http://stackoverflow.com/questions/17000142/converting-entity-framework-model-to-data-contract and it said I don't need to put DataContract attribute.. I am now confused... – ShamirDaj Mar 29 '15 at 12:09
  • You will be required to use a DTO or refer this link: http://stackoverflow.com/questions/7405909/wcf-entity-framework-how-to-get-a-nice-datacontract – Saravanan Mar 29 '15 at 12:16

1 Answers1

1

I had similar problem, which was solved by removing the <security> element altogether.

abdulla
  • 61
  • 4