Exemple #1
0
        private static Address GetCleanAddress(Address address)
        {
            var intergrationId = ConfigurationManager.AppSettings["Stamps.Com.IntegratorId"];
            var userName       = ConfigurationManager.AppSettings["Stamps.Com.UserName"];
            var password       = ConfigurationManager.AppSettings["Stamps.Com.Password"];

            var swsim = new Swsimv42SoapClient();

            var credential = new Credentials
            {
                IntegrationID = new Guid(intergrationId),
                Username      = userName,
                Password      = password
            };
            DateTime lastLoginTime;
            bool     clearCredential;
            string   loginBannerText;
            bool     passworExpired;
            bool     codewordsSet;
            var      authenticator = swsim.AuthenticateUser(credential, out lastLoginTime, out clearCredential, out loginBannerText,
                                                            out passworExpired, out codewordsSet);

            System.Console.WriteLine(authenticator);


            CleanseAddressRequest request = new CleanseAddressRequest
            {
                Address = address
            };

            ResidentialDeliveryIndicatorType residential;
            bool addressMatch;
            bool cityStateZipOk;
            bool?isPoBox;

            Address[]   candidateAddresses;
            StatusCodes statusCodes;

            RateV15[] rates;
            swsim.CleanseAddress(authenticator, ref request.Address, "90232", out addressMatch, out cityStateZipOk,
                                 out residential, out isPoBox, out candidateAddresses, out statusCodes, out rates);
            Console.WriteLine(addressMatch);
            if (addressMatch)
            {
                address = request.Address;
            }
            return(address);
        }
Exemple #2
0
        private static Address GetCleanAddress(Address address)
        {
            var intergrationId = ConfigurationManager.AppSettings["Stamps.Com.IntegratorId"];
            var userName = ConfigurationManager.AppSettings["Stamps.Com.UserName"];
            var password = ConfigurationManager.AppSettings["Stamps.Com.Password"];

            var swsim = new Swsimv42SoapClient();

            var credential = new Credentials
            {
                IntegrationID = new Guid(intergrationId),
                Username = userName,
                Password = password
            };
            DateTime lastLoginTime;
            bool clearCredential;
            string loginBannerText;
            bool passworExpired;
            bool codewordsSet;
            var authenticator = swsim.AuthenticateUser(credential, out lastLoginTime, out clearCredential, out loginBannerText,
                out passworExpired, out codewordsSet);
            System.Console.WriteLine(authenticator);

            CleanseAddressRequest request = new CleanseAddressRequest
            {
                Address = address
            };

            ResidentialDeliveryIndicatorType residential;
            bool addressMatch;
            bool cityStateZipOk;
            bool? isPoBox;
            Address[] candidateAddresses;
            StatusCodes statusCodes;
            RateV15[] rates;
            swsim.CleanseAddress(authenticator, ref request.Address, "90232", out addressMatch, out cityStateZipOk,
                out residential, out isPoBox, out candidateAddresses, out statusCodes, out rates);
            Console.WriteLine(addressMatch);
            if (addressMatch)
            {
                address = request.Address;
            }
            return address;
        }