I have connected a Third Party Web service with my web application, it is working fine
in localhost. But after i uploaded the project in server it is showing the following error.
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 100.100.100.100:9090
The following exception i got after i tried to connect the web service:
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 100.100.100.100:9090]
System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddresssocketAddress) +251System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +279
I have searched a lot. I am new to web service. Please let me know if you need more information.
Thanks in advance,
Please check if the Firewall disable the port of the web service. You may try utilize
Network Monitor
to analyze packets or use System.NET tracing to read logs.
Best Regards.
Please mark the replies as answers if they help or unmark if not.
Feedback to us
Thirisangu
Member
26 Points
187 Posts
"A Connection attempt Failed.." Error during at Soap Request in Asp.net
Nov 07, 2012 03:01 AM|LINK
I have connected a Third Party Web service with my web application, it is working fine
in localhost. But after i uploaded the project in server it is showing the following error.
Here is my Soap Request:
StringBuilder soapmsg = new StringBuilder(); soapmsg.Append("<?xml version='1.0' encoding='UTF-8'?>"); soapmsg.Append("<soap:Envelope xmlns='http://www.opentravel.org/OTA/2003/05' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/' xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext'>"); soapmsg.Append("<soap:Body><OTA_AirLowFareSearchRQ EchoToken='' SequenceNmbr='0' TransactionIdentifier='0' Version='1.001' xmlns='http://www.opentravel.org/OTA/2003/05' DirectFlightsOnly='false'>"); soapmsg.Append("<POS xmlns='http://www.opentravel.org/OTA/2003/05'><Source AgentSine='' PseudoCityCode='NPCK' TerminalID='1'><RequestorID ID='AFFILIATE'/></Source><YatraRequests><YatraRequest AffiliateID='YTFABTRAVEL' MidOfficeAgentID='' AgentEmailID='' Destination='' AgentTypeCode='' Description='' DoNotCache='false' DoNotHitCache='true' IsYatraAgent='' LastResultFromCache='true' RequestType='"+di+"' YatraRequestTypeCode='SMPA'/></YatraRequests></POS>"); soapmsg.Append("<OriginDestinationInformation>"); soapmsg.Append("<DepartureDateTime WindowAfter='" + flexi + "' WindowBefore='" + flexi + "'>" + date + "</DepartureDateTime>"); soapmsg.Append("<OriginLocation CodeContext='IATA' LocationCode='" + origin + "'>'" + origin + "'</OriginLocation>"); soapmsg.Append("<DestinationLocation CodeContext='IATA' LocationCode='" + destination + "'>'" + destination + "'</DestinationLocation>"); soapmsg.Append("</OriginDestinationInformation>"); soapmsg.Append("</OTA_AirLowFareSearchRQ></soap:Body></soap:Envelope>"); HttpWebRequest request = (HttpWebRequest)WebRequest.CreateDefault(new Uri(@"http://100.100.100.100:9090/services/spm/spm")); request.ContentType = "text/xml; charset=utf-8"; request.Method = "POST"; request.Accept = "text/xml"; request.Headers.Add("SOAPAction", @"http://100.100.100.100:9090/services/spm/spm"); StreamWriter writer = new StreamWriter(request.GetRequestStream(), Encoding.UTF8); writer.Write(soapmsg); writer.Flush(); writer.Close(); using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { XNamespace ns = "http://www.opentravel.org/OTA/2003/05"; XDocument xd = XDocument.Load(response.GetResponseStream()); }The following exception i got after i tried to connect the web service:
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 100.100.100.100:9090] System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddresssocketAddress) +251System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +279I have searched a lot. I am new to web service.
Please let me know if you need more information.
Thanks in advance,
Haixia Xie -...
Contributor
3031 Points
296 Posts
Microsoft
Re: "A Connection attempt Failed.." Error during at Soap Request in Asp.net
Nov 08, 2012 06:50 AM|LINK
Hi Thirisangu,
Please check if the Firewall disable the port of the web service. You may try utilize Network Monitor to analyze packets or use System.NET tracing to read logs.
Best Regards.
Feedback to us
Develop and promote your apps in Windows Store
Thirisangu
Member
26 Points
187 Posts
Re: "A Connection attempt Failed.." Error during at Soap Request in Asp.net
Nov 08, 2012 07:36 AM|LINK
Hi,
Thanks for your replay. I will check and post here.
Thirisangu
Member
26 Points
187 Posts
Re: "A Connection attempt Failed.." Error during at Soap Request in Asp.net
Nov 08, 2012 10:20 AM|LINK
Hi,
The third party did not provide rights to Host Server. They have given.
Now everything is ok.