Error connecting to a web service

Discussion in 'ASP.NET 2.0' started by astankovic, Dec 14, 2007.

  1. Hi,

    I'm trying to connect to a SOAP Web Service from a page hosted on discountASP.net and I'm getting an exception "System.Net.WebException: Unable to connect to the remote server..."
    The remote server is responding, and the application works from the in house test server. It only fails when executing from discountASP.net servers.

    Are you guys behind a proxy? Why can't I connect to an external web service? Again this is happening on discountASP.net servers only, the service and the page work fine. The response I got from technical support was to post to the forum.

    Any suggestions would be greatly appreciated.

    Thanks,
    Alex

    Full Exception:


    Server Error in '/AngelTestWeb' Application.
    --------------------------------------------------------------------------------

    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 208.206.234.80:80
    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 208.206.234.80:80

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:


    [SocketException (0x274c): 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 208.206.234.80:80]
    System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) +1073657
    System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) +33
    System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +217

    [WebException: Unable to connect to the remote server]
    System.Net.HttpWebRequest.GetRequestStream() +1534317
    System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) +103
    AngelTestWeb.com.angel.www.OutboundCallService.login(login login1) in C:\Documents and Settings\astankovic\My Documents\Visual Studio 2005\Projects\AngelTestWeb\AngelTestWeb\Web References\com.angel.www\Reference.cs:156
    AngelTestWeb._Default.Button1_Click(Object sender, EventArgs e) in C:\Documents and Settings\astankovic\My Documents\Visual Studio 2005\Projects\AngelTestWeb\AngelTestWeb\Default.aspx.cs:44
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +105
    System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +107
    System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +7
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
    System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746




    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Nope. We are not blocking external HTTP connection.


    Does the target server has IP restriction?


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. They say they are not blocking access from any IP. And I can access their service from any other server I tested it from. The problemis only when connecting from discountASP.net site.

    To debug I setup a page that does a HttpWebRequest to the IP like shown below:

     
  4. Bruce

    Bruce DiscountASP.NET Staff

    I can't do much trouble shooting here in the forum. I recommend you create a support ticket and we can try connect to port 80 from the server.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     

Share This Page