locked
A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond RRS feed

  • Question

  • User16526634 posted

    Background:

    I am running a e-commerce website which will call a remote payment gateway when customer check out.

    I have tested my web application at my local machine. Everything just works fine. I have no problem to connect my payment gateway

     However, after I have upload all my application code to my hosting company, I cannot check out because my web application cannot connect to the payment gateway

    And get following errors:

    "

    A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond

    Source Error:

    Line 154:						OrderNumber = AppLogic.GetNextOrderNumber();
    Line 155:						//String status = Gateway.MakeOrder(cart,"Credit Card",String.Empty,CardName,CardType,CardNumber,CardExtraCode,CardExpirationMonth,CardExpirationYear,OrderNumber,String.Empty, String.Empty, String.Empty,String.Empty,String.Empty,String.Empty,String.Empty,String.Empty);
    Line 156:						String status = Gateway.MakeOrder(cart,OrderNumber);
    Line 157:						if(status != "OK")
    Line 158:						{

    :

    The application code (c#) has used httpwebrequest to create the connection with the payment gateway.

    HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(AuthServer)

     The payment gateway interface is https://process.gatewaycompany.com/trans.asp

    I have checked with my hosting company, they said they have not use proxy on the hosting server, neither have they blocked port 443 for outbound https connection.

    I also changed another hosting company. still getting the same error.

    I have also added followng cofig parameter in my web.config

    " <system.net>

       <defaultProxy>

        <proxy bypassonlocal="true" usesystemdefault="false" />

       </defaultProxy>

      </system.net> "

    but still helpless

    Thanks for reading this and Please help

     [:(]

     

    Wednesday, March 21, 2007 3:16 AM

All replies

  • User1024994265 posted

    Hi,

    I'm having the same error only in quality testing environment, but it only happened once in a while. Lately it began to happen very often and consistently.

    As far as I can tell, there are no network connectivity problems (the web services used are accessible from the web application machines) and no proxys are used.

    The proxy config in web.config didn't help either.

    Did you find any solution to this problem?

    Thank you,

    Paulo Cunha
     

    Monday, May 7, 2007 11:57 AM
  • User-853852349 posted

     I too am having this type of issue, and tried the suggested fix (I assumed the change went on the web service server's web.config).

    Lets see if someone from Microsoft can explain. 

    Friday, June 15, 2007 11:56 AM
  • User1794670917 posted

     I'm having the same problem!

     Did you find any solution? I'm tearing my hair out here.

     


     

    Friday, June 22, 2007 10:45 AM
  • User-853852349 posted

     The only solution I found was to install VS on the server.

     Chime in here, perhaps MS will listen if more than one of us complains.

    https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283035
     

    Friday, June 22, 2007 2:06 PM
  • User-1401991022 posted

    Yep me too. I'mhaving the same problem. Am trying to do a simple httpWebRequest. Have tried using both intranet and internt URLs and neither work. Keep getting

     A connection attempt failed because the connected party did not properly respond after a period of time

    Sunday, June 24, 2007 9:17 PM
  • User-853852349 posted

     Please update this page https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=283035 as it is monitored by MSFT.

    Monday, June 25, 2007 9:49 AM
  • User472117617 posted

    This sounds like a simple network issue.  Either your local network or the payment provider endpoint is too busy or unavailable.  Perhaps you should write your code in a way that will retry the connection a specified number of times.  It may be true that there is some bug or poor code in the framework that is causing this, but it is more likely that the network is letting you down.  After all, no network is 100% available 100% of the time, so it makes sense to write your code accordingly. 

    Monday, June 25, 2007 10:24 AM
  • User-551845998 posted

     

    This sounds like a simple network issue.

    I am not sure...

    Perhaps you should write your code in a way that will retry the connection a specified number of times

    Useful to avoid exceptions caused by bottlenecks at server side but not sufficient for the described problem when it occurs permanently.

    I think, this is a problem caused by the security configuration of the remote server.

    1) Should you try first to configure it with Caspol.exe,

     http://msdn.microsoft.com/en-us/library/cb6t8dtz(VS.80).aspx

    2) if 1) does not work, try again with the .NET Framework Configuration Tool (Mscorcfg.msc) (that comes with the .NET Framework SDK (354 MB)  ;-(

    Section : Remoting Services/View Remoting Services Properties

    Give us please a feed-back with addfulltrust option added to your application server assembly.

    David
     

     


     

    Tuesday, October 16, 2007 11:45 AM
  • User-1806735922 posted

    Hello... What if remoting services properties is empty... I see no way to add anything there?problems

    EDIT: I'm running IIS7 on windows server 2008 if that means something to you...it's almost vanilla. not much was tweaked.

    Monday, August 18, 2008 12:45 PM
  • User1510652748 posted

    I have exactly the same problem, the website is working fine in localhost but not on live. The payment provider endpoint is also available. I have double checked with the gateway provider. It's pulling out my hair and any help will be much appreciated.

    I am hosting on a shared server and so I cannot install any tools.
    Sunday, November 9, 2008 3:28 PM
  • User-1215350494 posted

    I ran into this as well.  My problem was that I needed to send an email from exchange via my web app.  Our exchange server has two IP's (.60 and .62).  I setup the site locally using .60.  When I tried to recover a password using the built-in password recovery tool, while the site was in production, I got the error..  When I changed it to .62, everything worked fine.  Not much of an answer, but that was my issue...

    Friday, January 23, 2009 2:14 PM
  • Tuesday, September 24, 2013 4:51 AM