Ejemplo n.º 1
0
        public static SuperAvailabilityResponse Search(AccommodationSearchRequest request, Settings settings, AggregatorSetting aggregatorSetting, out int searchTime)
        {
            var availabilityRequest = GetRequest(request, aggregatorSetting, settings);

            var authSoapHd = new AuthSoapHd
            {
                strUserName   = aggregatorSetting.PtsUserName,
                strNetwork    = aggregatorSetting.PtsNetwork,
                strPassword   = aggregatorSetting.PtsPassword,
                strUserRef    = "",
                strCustomerIP = "" //HttpContext.Current == null ? String.Empty : (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]).Split(',')[0].Trim()
            };


            //"http://172.16.200.174/Tritonroomswsdev/AccommodationServicev2.svc";
            var service = new  AccommodationService {
                Url = aggregatorSetting.PtsUrl, AuthSoapHdValue = authSoapHd, Timeout = aggregatorSetting.PtsTimeOut
            };
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            SuperAvailabilityResponse response = service.GetSuperAvailability(availabilityRequest);

            stopwatch.Stop();
            searchTime = (int)stopwatch.ElapsedMilliseconds;

            return(response);
        }
Ejemplo n.º 2
0
        public static AuthSoapHd ServiceAuthentication()
        {
            AuthSoapHd objAuth = new AuthSoapHd();

            objAuth.strUserName = Constants.ServiceUserName;
            objAuth.strPassword = Constants.ServicePassword;
            return(objAuth);
        }
        public static AuthSoapHd GetAuthSoapHd()
        {
            var objAuthSoapHeader = new AuthSoapHd
            {
                strUserName = ConfigurationSettings.AppSettings["webServiceUserName"],
                strPassword = ConfigurationSettings.AppSettings["webServicePassword"]
            };

            return(objAuthSoapHeader);
        }
Ejemplo n.º 4
0
        static void Main(string[] args)
        {
            using (var client = new HelloWorldSoapClient())
            {
                AuthSoapHd authHeader = new AuthSoapHd
                {
                    UserName = "******",
                    Password = "******"
                };

                var result = client.AuthTest(authHeader);
                Console.WriteLine("Result: {0}", result);
            }

            Console.ReadLine();
        }
Ejemplo n.º 5
0
        public static TransfersResponseV3 Search(TransfersRequestV3 request, AggregatorSetting aggregatorSetting)
        {
            var authSoapHd = new AuthSoapHd
            {
                strUserName   = aggregatorSetting.PtsUserName,
                strNetwork    = aggregatorSetting.PtsNetwork,
                strPassword   = aggregatorSetting.PtsPassword,
                strUserRef    = "",
                strCustomerIP = "" //HttpContext.Current == null ? String.Empty : (HttpContext.Current.Request.ServerVariables["HTTP_X_FORWARDED_FOR"] ?? HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]).Split(',')[0].Trim()
            };

            var service = new AccommodationService {
                Url = aggregatorSetting.PtsUrl, AuthSoapHdValue = authSoapHd, Timeout = aggregatorSetting.PtsTimeOut
            };
            var stopwatch = new Stopwatch();

            stopwatch.Start();
            TransfersResponseV3 response = service.GetTransfersV3(request);

            stopwatch.Stop();

            return(response);
        }