Example #1
0
        private void ReadPNR(string token)
        {
            TravelItineraryRead.TravelItineraryReadPortTypeClient client = TIR.returnClient(token);

            TravelItineraryRead.MessageHeader message_header = TIR.returnMessageHeader();
            TravelItineraryRead.Security1     security       = TIR.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;
            TravelItineraryRead.TravelItineraryReadRS response;
            try
            {
                response = client.TravelItineraryReadRQ(ref message_header, ref security, WSPayloads.buildRequestForTravelItinRead());
                // MessageBox.Show(response.ToString());
                SerializeAndShowWSResponse(response);
            }
            catch (Exception e)
            {
                MessageBox.Show(e.Message);
            }
            finally
            {
            }
        }
Example #2
0
        public static TravelItineraryRead.TravelItineraryReadPortTypeClient returnClient(string token)
        {
            TravelItineraryRead.TravelItineraryReadPortTypeClient client = new TravelItineraryRead.TravelItineraryReadPortTypeClient();

            string endpoint = Util.ReadToken(token);

            client.Endpoint.Address = new EndpointAddress(endpoint);


            return(client);
        }