private string GetHotels(string sc, string searchid) { string rq = ""; //pcc = "VL5H"; //ipcc = "7A7H"; ; //username = "******"; //password = "******"; //result = XMLRead.ContextChange(pcc,ipcc,username,password,searchid); result = XMLRead.ContextChange(searchid); ContextResult = result; if (result.ToString() != "") { DataSet ds = new DataSet(); DataSet dsSession = new DataSet(); StringReader se_stream = new StringReader(result); dsSession.ReadXml(se_stream); string Rq = ""; if (dsSession.Tables["BinarySecurityToken"] != null) { DataTable dtBinarySecurityToken = dsSession.Tables["BinarySecurityToken"]; DataTable dtMessageData = dsSession.Tables["MessageData"]; DataTable dtMessageHeader = dsSession.Tables["MessageHeader"]; string timestamp = DateTime.UtcNow.ToString(); rq = GetRq(dtBinarySecurityToken, dtMessageData, dtMessageHeader, sc); result = XMLRead.SendQuery(rq); XMLRead.SaveXMLFile(rq, result, searchid + "_hotelsAvail"); } } return(result); }
public PNRData(string searchid, CustomerInfo ci, string rph, string ContextResult, string BookinID) { //string filePathContext = Path.Combine(HttpRuntime.AppDomainAppPath, "HotelXML/" + searchid + "_ContextChange-RS.xml"); //if (File.Exists(filePathContext)) //{ // ContextResult = File.ReadAllText(filePathContext); //} //else //{ // ContextResult = XMLRead.ContextChange(searchid); //} string result = ""; int rphl = rph.ToString().Length; if (rphl == 1) { rph = "0" + rph.ToString(); } string RateBodyRQ = GetRateDescBodyRQ(rph); string PassengerBodyRQ = GetPassengerBodyRQ(ci); string HoteResBodyRQ = GetHotelResBodyRQ(ci, rph); string RateRQ = GetRateDescRQ(ContextResult, RateBodyRQ); result = XMLRead.SendQuery(RateRQ); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_RateDesec"); string PassengerRQ = GetPassengerXMLRQ(result, PassengerBodyRQ); result = XMLRead.SendQuery(PassengerRQ); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_PassengerDet"); string HotelResRq = GetHotelResXMLRQ(result, HoteResBodyRQ); result = XMLRead.SendQuery(HotelResRq); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_HotelResDet"); string EndTransRQ = GetEndTransRQ(result); result = XMLRead.SendQuery(EndTransRQ); XMLRead.SaveXMLFile(RateRQ, result, BookinID + "_EndTrans"); string EndTransXML = result; Hes = new HotelEndTrans(EndTransXML); if (result.ToString() != "") { DataSet ds = new DataSet(); DataSet dsSession = new DataSet(); StringReader se_stream = new StringReader(result); dsSession.ReadXml(se_stream); string Rq = ""; if (dsSession.Tables["BinarySecurityToken"] != null) { DataTable dtBinarySecurityToken = dsSession.Tables["BinarySecurityToken"]; DataTable dtMessageData = dsSession.Tables["MessageData"]; DataTable dtMessageHeader = dsSession.Tables["MessageHeader"]; string timestamp = DateTime.UtcNow.ToString(); string cresult = XMLRead.closession(dtMessageData.Rows[0]["MessageId"].ToString(), timestamp, dtBinarySecurityToken.Rows[0]["BinarySecurityToken_Text"].ToString(), searchid + "_PNREndTrans", XMLRead.pcc, XMLRead.ipcc); } } }
public string GetImageXMLContext(string Hotelcode, string searchid, string ContextResult) { XMLRead xmlHotelImage = new XMLRead(); string rq = ""; string result = ""; rq = GetXMLRQ(ContextResult, Hotelcode); result = XMLRead.SendQuery(rq); XMLRead.SaveXMLFile(rq, result, searchid + "_hotelsImage" + "_" + Hotelcode); return(result); }
private string GetPropDescRQ(string result, string PropDescRQ) { string rq = ""; if (result.ToString() != "") { DataSet ds = new DataSet(); DataSet dsSession = new DataSet(); StringReader se_stream = new StringReader(result); dsSession.ReadXml(se_stream); if (dsSession.Tables["BinarySecurityToken"] != null) { DataTable dtBinarySecurityToken = dsSession.Tables["BinarySecurityToken"]; DataTable dtMessageData = dsSession.Tables["MessageData"]; DataTable dtMessageHeader = dsSession.Tables["MessageHeader"]; string timestamp = DateTime.UtcNow.ToString(); rq = "<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>"; rq += "<SOAP-ENV:Header>"; rq += "<eb:MessageHeader xmlns:eb='http://www.ebxml.org/namespaces/messageHeader' SOAP-ENV:mustUnderstand='1' eb:version='2.0'>"; rq += "<eb:From>"; rq += "<eb:PartyId type='urn:x12.org:IO5:01'>WebServiceClient</eb:PartyId>"; rq += " </eb:From>"; rq += "<eb:To>"; rq += " <eb:PartyId type='urn:x12.org:IO5:01'>WebServiceSupplier</eb:PartyId>"; rq += "</eb:To>"; rq += " <eb:CPAId>" + pcc + "</eb:CPAId>"; rq += " <eb:ConversationId>" + dtMessageHeader.Rows[0]["ConversationId"].ToString() + "</eb:ConversationId>"; rq += " <eb:Service eb:type='OTA'>Air Shopping Service</eb:Service>"; rq += "<eb:Action>HotelPropertyDescriptionLLSRQ</eb:Action>"; rq += "<eb:MessageData>"; rq += " <eb:MessageId>" + dtMessageData.Rows[0]["MessageId"].ToString() + "</eb:MessageId>"; rq += "<eb:Timestamp>" + dtMessageData.Rows[0]["Timestamp"].ToString() + "</eb:Timestamp>"; rq += "</eb:MessageData>"; rq += "<eb:RefToMessageId>" + dtMessageData.Rows[0]["ReftoMessageId"].ToString() + "</eb:RefToMessageId> "; rq += "<eb:DuplicateElimination /> "; rq += "</eb:MessageHeader>"; rq += "<wsse:Security xmlns:wsse='http://schemas.xmlsoap.org/ws/2002/12/secext' xmlns:wsu='http://schemas.xmlsoap.org/ws/2002/12/utility'>"; rq += "<wsse:BinarySecurityToken valueType='String' EncodingType='wsse:Base64Binary'>" + dtBinarySecurityToken.Rows[0]["BinarySecurityToken_Text"].ToString() + "</wsse:BinarySecurityToken>"; rq += "</wsse:Security>"; rq += "</SOAP-ENV:Header>"; rq += PropDescRQ; rq += "</SOAP-ENV:Envelope>"; result = XMLRead.SendQuery(rq); } } return(rq); }
private string GetHotel(string rqbody, string searchid, string hotelcode, string CurrencyCode, string b2c_idn) { string rq = ""; XMLRead.GetPccDetails(b2c_idn); string htlAvuri = ConfigurationManager.AppSettings["HotelPortalUri"] != null ? ConfigurationManager.AppSettings["HotelPortalUri"].ToString() : string.Empty; if (!string.IsNullOrEmpty(htlAvuri)) { result = XMLRead.SendQuery(rqbody, htlAvuri); XMLRead.SaveXMLFile(rqbody, result, searchid + "_propertydesc_" + hotelcode + "_" + CurrencyCode + "_hotelsAvail"); } return(result); }
public string Getrates(string sc, string SearchID, string ratekey, string b2c_idn) { string result = ""; string[] ratekeys = ratekey.Split(','); //string ratekey_split = ratekey.Substring(ratekey.Length - 4); string ratekey_split = ratekeys[0].Substring(ratekeys[0].Length - 4); // ManageHDetAj mhd = new ManageHDetAj(); // HotelPropertyAj hpr = mhd.GetData(searchid, hcode,"USD"); string htlchkuri = ConfigurationManager.AppSettings["HotelPortalBookingUri"] != null ? ConfigurationManager.AppSettings["HotelPortalCheckRateUri"].ToString() : string.Empty; if (!string.IsNullOrEmpty(htlchkuri)) { result = XMLRead.SendQuery(sc, htlchkuri); SaveXMLFilec(sc, result, SearchID + "_" + ratekey_split + "_checkrate"); } return(result); }
public string GetImageXML(string Hotelcode, string searchid) { //pcc = "VL5H"; //ipcc = "7A7H"; ; //username = "******"; //password = "******"; //XMLRead xmlHotelImage = new XMLRead(); string result = ""; // result = XMLRead.ContextChange(pcc, ipcc, username, password, searchid); result = XMLRead.ContextChange(searchid); string rq = ""; rq = GetXMLRQ(result, Hotelcode); result = XMLRead.SendQuery(rq); XMLRead.SaveXMLFile(rq, result, searchid + "_hotelsImage" + "_" + Hotelcode); return(result); }
public PNRDataAj(string searchid, CustomerInfo ci, string rph, string BookinID, string hotelcode, string CurrencyCode, string b2c_idn, string rooms, string Guestdet) { string ratekey = string.Empty; string cmdtxtrkey = "select HB_RateKey from HotelBooking where Bookingidn=" + BookinID + ""; DataTable dtrkey = manage_data.GetDataTable(cmdtxtrkey, manage_data.con); if (dtrkey.Rows.Count > 0) { ratekey = dtrkey.Rows[0]["HB_RateKey"].ToString(); } //// temporarily commented //string filePathContext = Path.Combine(HttpRuntime.AppDomainAppPath, "HotelXML/" + searchid + "_ContextChange-RS.xml"); //if (File.Exists(filePathContext)) //{ // ContextResult = File.ReadAllText(filePathContext); //} //else //{ // ContextResult = XMLRead.ContextChange(searchid); //} DataTable dtpcc = manage_data.getpccdetails(b2c_idn); if (dtpcc.Rows.Count > 0) { cnphone = dtpcc.Rows[0]["cust_identifier"].ToString().Substring(0, 3) + "-" + dtpcc.Rows[0]["cust_identifier"].ToString().Substring(3, 3) + "-" + dtpcc.Rows[0]["cust_identifier"].ToString().Substring(6, 4); cident = dtpcc.Rows[0]["cust_identifier"].ToString(); pcc = dtpcc.Rows[0]["prv_pcc"].ToString(); ipcc = dtpcc.Rows[0]["prv_ipcc"].ToString(); username = dtpcc.Rows[0]["prv_username"].ToString(); password = dtpcc.Rows[0]["prv_pwd"].ToString(); } XMLRead.GetPccDetails(b2c_idn); string result = ""; result = XMLRead.ContextChange(searchid + "_" + hotelcode + "_PNR"); int rphl = rph.ToString().Length; if (rphl == 1) { rph = "0" + rph.ToString(); } //string RateBodyRQ = GetRateDescBodyRQ(rph); //string PassengerBodyRQ = GetPassengerBodyRQ(ci, Guestdet); string htlbkuri = ConfigurationManager.AppSettings["HotelPortalBookingUri"] != null ? ConfigurationManager.AppSettings["HotelPortalBookingUri"].ToString() : string.Empty; if (!string.IsNullOrEmpty(htlbkuri)) { string HoteResBodyRQ = GetHotelResBodyRQ(searchid, ci, rph, rooms, ratekey, BookinID); result = XMLRead.SendQuery(HoteResBodyRQ, htlbkuri); XMLRead.SaveXMLTextFile(HoteResBodyRQ, result, searchid + "_" + BookinID + "_PNRHotelResDet"); //searchid = "7430"; //BookinID = "1918"; string filePathRQ = Path.Combine(HttpRuntime.AppDomainAppPath, "HotelXML/" + searchid + "_" + BookinID + "_PNRHotelResDet" + "-RS.xml"); result = File.ReadAllText(filePathRQ); //string RateRQ = GetRateDescRQ(result, RateBodyRQ); //result = XMLRead.SendQuery(RateRQ); //XMLRead.SaveXMLTextFile(RateRQ, result, searchid + "_" + BookinID + "_PNRRateDesec"); //string PassengerRQ = GetPassengerXMLRQ(result, PassengerBodyRQ); //result = XMLRead.SendQuery(PassengerRQ); //XMLRead.SaveXMLTextFile(PassengerRQ, result, searchid + "_" + BookinID + "_PNRPassengerDet"); //string HotelResRq = GetHotelResXMLRQ(result, HoteResBodyRQ); //result = XMLRead.SendQuery(HotelResRq); //XMLRead.SaveXMLTextFile(HotelResRq, result, searchid + "_" + BookinID + "_PNRHotelResDet"); //string EndTransRQ = GetEndTransRQ(result); //result = XMLRead.SendQuery(EndTransRQ); //XMLRead.SaveXMLTextFile(EndTransRQ, result, searchid + "_" + BookinID + "_PNREndTrans"); string EndTransXML = result; Hes = new HotelEndTrans(EndTransXML, BookinID, filePathRQ); ////closing the session //if (result.ToString() != "") //{ // DataSet ds = new DataSet(); // DataSet dsSession = new DataSet(); // StringReader se_stream = new StringReader(result); // dsSession.ReadXml(se_stream); // string Rq = ""; // if (dsSession.Tables["BinarySecurityToken"] != null) // { // DataTable dtBinarySecurityToken = dsSession.Tables["BinarySecurityToken"]; // DataTable dtMessageData = dsSession.Tables["MessageData"]; // DataTable dtMessageHeader = dsSession.Tables["MessageHeader"]; // string timestamp = DateTime.UtcNow.ToString(); // string cresult = XMLRead.closession(dtMessageData.Rows[0]["MessageId"].ToString(), timestamp, dtBinarySecurityToken.Rows[0]["BinarySecurityToken_Text"].ToString(), searchid + "_" + BookinID + "_PNR", XMLRead.pcc, XMLRead.ipcc); // } //} } }