サード パーティの Web サービスを Web アプリケーションに接続しました。 localhostで正常に動作しています。しかし、サーバーにプロジェクトをアップロードした後、次のエラーが表示されます。
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
これが私の石鹸リクエストです:
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) +279
私はたくさん検索しました。私はWebサービスが初めてです。 さらに情報が必要な場合はお知らせください。 前もって感謝します、