none
WCF Response Disappears - HTTP/1.1 504 Fiddler - Receive Failure - [Fiddler] ReadResponse() failed: The server did not return a response for this request.Server returned 0 bytes

    Question

  • I have WPF client which is talking to a WCF Service. On sending big request from the wpf client to WCF service, i am not getting back with the response from WCF sometimes. I am getting Null as response. Its look like data is being disappear on the wire and not sure about that. I have tried to enable WCF tracing and there is no exception in it :( Not sure what went wrong. I have increased the timeout in IIS to 900 seconds. But  no luck. I have increased the buffer size in bindings and all possible web.config settings and no luck. Any one can help me on this issue. Thaks a lot for your help in advance. 

    http://www.selvaonline.com - Live a Happy & Balanced Life



    • Edited by SelvaOnline Friday, September 27, 2013 7:14 PM
    Friday, September 27, 2013 7:11 PM

Answers

  • What I would do is create a Functional Test project that consumes the WCF service and include any projects sitting behind the WCF service with all of this in one solution. I would use either Nunit, MBunit or Microsoft.VisualStudio.TestTools.UnitTesting. I would create a test method that made the call to the WCF service. I would download the full version 30 day trial version of Resharper. Resharper has the power to  host the test project, make the call in debug mode and you can single step all the way from the test method client code, right into the WCF service code and see what is happening between the client and the WCF service. You can use an App.config at the Functional test project level for the client side WCF config information, connectionstrings, etc etc.

    That's what I would do in an attempt to see what is happening by watching the code execute.

    Sunday, September 29, 2013 8:00 AM
  • Check the http headers.  Adding headers may solve the problem, or deleting cookies may help.  Here are som euseful things to look at

    1) Use the cmd.exe command : "Netstat -a".  The command give a list of port numbers and client they are coonected to.  Use the command on both the client and server.  Sometimes a connection doesn't close properly so the next time the connection is attempted you will get a failure.  So use the command before and after attempting to make the connection.

    2) The server may have anti spoofing software to prevent hackers from repeately attacking the server.  If you attempt to connect too many times and fail you may get locked out by the server.

    3) When a http connection is started there is an exchange of headers that take place between the client and server and a negotiation takes place to find a common connection mode.  The http headers are used to perform the negotations.  So if you send a header that the server rejects the server will sometimes send back a null message.  for example if the server is only set up to run with a secure connection (https) and you try to connect with http you will get rejected.  I normally try to connect using my IE webbrowser manually and capture the connection using a sniffer.  Then try again using my VS application.  I make sure I delete cookies between the two attempts.  The cookies can be deleted in the IE application in the menu Tools - Internet options.  I then compare the http headers with the IE and VS.   Then I correct the headers in the VS application to look like the IE.


    jdweng

    Tuesday, October 01, 2013 5:57 AM
  • Is your problem solved?

    jdweng

    • Marked as answer by SelvaOnline Friday, October 04, 2013 12:48 PM
    Tuesday, October 01, 2013 2:28 PM

All replies

  • What I would do is create a Functional Test project that consumes the WCF service and include any projects sitting behind the WCF service with all of this in one solution. I would use either Nunit, MBunit or Microsoft.VisualStudio.TestTools.UnitTesting. I would create a test method that made the call to the WCF service. I would download the full version 30 day trial version of Resharper. Resharper has the power to  host the test project, make the call in debug mode and you can single step all the way from the test method client code, right into the WCF service code and see what is happening between the client and the WCF service. You can use an App.config at the Functional test project level for the client side WCF config information, connectionstrings, etc etc.

    That's what I would do in an attempt to see what is happening by watching the code execute.

    Sunday, September 29, 2013 8:00 AM
  • Thanks for your reply !

    The issue works absolutely fine in local host and the issue occurs only contacting the WCF service in a webserver. Also in webserver, when we use http://<<ip address>>:<<portnumber>> to contact the service, it works fine and it is not working when we use the F5 url.


    http://www.selvaonline.com - Live a Happy & Balanced Life

    Tuesday, October 01, 2013 3:38 AM
  • <snipped>

    The issue works absolutely fine in local host and the issue occurs only contacting the WCF service in a webserver.

    <end>

    Are you talking localhost as with the VS development server or are you talking about localhost IIS?

    Tuesday, October 01, 2013 4:40 AM
  • Check the http headers.  Adding headers may solve the problem, or deleting cookies may help.  Here are som euseful things to look at

    1) Use the cmd.exe command : "Netstat -a".  The command give a list of port numbers and client they are coonected to.  Use the command on both the client and server.  Sometimes a connection doesn't close properly so the next time the connection is attempted you will get a failure.  So use the command before and after attempting to make the connection.

    2) The server may have anti spoofing software to prevent hackers from repeately attacking the server.  If you attempt to connect too many times and fail you may get locked out by the server.

    3) When a http connection is started there is an exchange of headers that take place between the client and server and a negotiation takes place to find a common connection mode.  The http headers are used to perform the negotations.  So if you send a header that the server rejects the server will sometimes send back a null message.  for example if the server is only set up to run with a secure connection (https) and you try to connect with http you will get rejected.  I normally try to connect using my IE webbrowser manually and capture the connection using a sniffer.  Then try again using my VS application.  I make sure I delete cookies between the two attempts.  The cookies can be deleted in the IE application in the menu Tools - Internet options.  I then compare the http headers with the IE and VS.   Then I correct the headers in the VS application to look like the IE.


    jdweng

    Tuesday, October 01, 2013 5:57 AM
  • Yes. You are correct.

    http://www.selvaonline.com - Live a Happy & Balanced Life

    Tuesday, October 01, 2013 1:10 PM
  • Is your problem solved?

    jdweng

    • Marked as answer by SelvaOnline Friday, October 04, 2013 12:48 PM
    Tuesday, October 01, 2013 2:28 PM