private void SendSabreCommand(String token) { SabreCommand.SabreCommandLLSPortTypeClient client = SabreCommandRequest.returnClient(token); SabreCommand.MessageHeader message_header = SabreCommandRequest.returnMessageHeader(); SabreCommand.Security security = SabreCommandRequest.returnSecurityHeader(token); // this line is to use TLS 1.2 otherwise it cannot connect to the end point System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; SabreCommand.SabreCommandLLSRS response; //string command = txtCommand.Text.ToUpper(); string command = "0HHTHIGK1JFKIN07JUL-OUT08JUL/HOLIDAY INN/DBLB/65.00USD/G/SI-" + Util.CHGKEY + "1900 VAN WYKE¥S OZONE PARK NY 10405¥FONE 212-555-1957¤REQUESTED SUITE/CF-62FE77"; SabreCommand.SabreCommandLLSRQ req = SabreCommandRequest.getRequest(token, command); SerializeAndShowWSResponse(req); try { response = client.SabreCommandLLSRQ(ref message_header, ref security, req); SerializeAndShowWSResponse(response); } catch (Exception e) { MessageBox.Show(e.StackTrace + "\"" + e.Message); Debug.Write(e.StackTrace); Debug.Write(e.Message); } finally { } }
public static SabreCommand.SabreCommandLLSPortTypeClient returnClient(string token) { SabreCommand.SabreCommandLLSPortTypeClient client = new SabreCommand.SabreCommandLLSPortTypeClient(); string endpoint = Util.ReadToken(token); client.Endpoint.Address = new EndpointAddress(endpoint); return(client); }