Exemplo n.º 1
0
        public AddressValidationReply addressValidation([System.Xml.Serialization.XmlElementAttribute(Namespace = "http://fedex.com/ws/addressvalidation/v4")] AddressValidationRequest AddressValidationRequest)
        {
            object[] results = this.Invoke("addressValidation", new object[] {
                AddressValidationRequest
            });

            return((AddressValidationReply)(results[0]));
        }
Exemplo n.º 2
0
 /// <remarks/>
 public void addressValidationAsync(AddressValidationRequest AddressValidationRequest, object userState)
 {
     if ((this.addressValidationOperationCompleted == null))
     {
         this.addressValidationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnaddressValidationOperationCompleted);
     }
     this.InvokeAsync("addressValidation", new object[] {
         AddressValidationRequest
     }, this.addressValidationOperationCompleted, userState);
 }
Exemplo n.º 3
0
 private static AddressValidationRequest CreateAddressValidationRequest()
 {
     // Build the AddressValidationRequest
     AddressValidationRequest request = new AddressValidationRequest();
     //
     request.WebAuthenticationDetail = new WebAuthenticationDetail();
     request.WebAuthenticationDetail.UserCredential = new WebAuthenticationCredential();
     //request.WebAuthenticationDetail.UserCredential.Key = "Cr0nkpIax2HSog22"; // Replace "XXX" with the Key
     //request.WebAuthenticationDetail.UserCredential.Password = "******"; // Replace "XXX" with the Password
     request.WebAuthenticationDetail.UserCredential.Key = "V4bqDWokgOVi4qsy"; // Replace "XXX" with the Key
     request.WebAuthenticationDetail.UserCredential.Password = "******"; // Replace "XXX" with the Password
     request.WebAuthenticationDetail.ParentCredential = new WebAuthenticationCredential();
     //request.WebAuthenticationDetail.ParentCredential.Key = "Cr0nkpIax2HSog22"; // Replace "XXX" with the Key
     //request.WebAuthenticationDetail.ParentCredential.Password = "******"; // Replace "XXX"
     request.WebAuthenticationDetail.ParentCredential.Key = "V4bqDWokgOVi4qsy"; // Replace "XXX" with the Key
     request.WebAuthenticationDetail.ParentCredential.Password = "******"; // Replace "XXX"            
     if (usePropertyFile()) //Set values from a file for testing purposes
     {
         request.WebAuthenticationDetail.UserCredential.Key = getProperty("key");
         request.WebAuthenticationDetail.UserCredential.Password = getProperty("password");
         request.WebAuthenticationDetail.ParentCredential.Key = getProperty("parentkey");
         request.WebAuthenticationDetail.ParentCredential.Password = getProperty("parentpassword");
     }
     //
     request.ClientDetail = new ClientDetail();
     //request.ClientDetail.AccountNumber = "287737831"; // Replace "XXX" with the client's account number
     //request.ClientDetail.MeterNumber = "106578628"; // Replace "XXX" with the client's meter number
     request.ClientDetail.AccountNumber = "510087500"; // Replace "XXX" with the client's account number
     request.ClientDetail.MeterNumber = "118687440"; // Replace "XXX" with the client's meter number
     if (usePropertyFile()) //Set values from a file for testing purposes
     {
         request.ClientDetail.AccountNumber = getProperty("accountnumber");
         request.ClientDetail.MeterNumber = getProperty("meternumber");
     }
     //
     request.TransactionDetail = new TransactionDetail();
     request.TransactionDetail.CustomerTransactionId = "***Address Validation Request using VC#***"; // The client will get the same value back in the reply
     //
     request.Version = new VersionId(); // Creates the Version element with all child elements populated
     //
     request.InEffectAsOfTimestamp = DateTime.Now;
     request.InEffectAsOfTimestampSpecified = true;
     //
     SetAddress(request);
     //
     return request;
 }
Exemplo n.º 4
0
 /// <remarks/>
 public void addressValidationAsync(AddressValidationRequest AddressValidationRequest, object userState) {
     if ((this.addressValidationOperationCompleted == null)) {
         this.addressValidationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnaddressValidationOperationCompleted);
     }
     this.InvokeAsync("addressValidation", new object[] {
                 AddressValidationRequest}, this.addressValidationOperationCompleted, userState);
 }
Exemplo n.º 5
0
 /// <remarks/>
 public void addressValidationAsync(AddressValidationRequest AddressValidationRequest) {
     this.addressValidationAsync(AddressValidationRequest, null);
 }
Exemplo n.º 6
0
        private static void SetAddress(AddressValidationRequest request)
        {
            request.AddressesToValidate = new AddressToValidate[4];
            request.AddressesToValidate[0] = new AddressToValidate();
            request.AddressesToValidate[0].ClientReferenceId = "ClientReferenceId1";
            request.AddressesToValidate[0].Address = new Address();
            request.AddressesToValidate[0].Address.StreetLines = new String[1] { "100 Nickerson RD" };
            request.AddressesToValidate[0].Address.PostalCode = "01752";
            request.AddressesToValidate[0].Address.City = "Marlborough";
            request.AddressesToValidate[0].Address.StateOrProvinceCode = "MA";
            request.AddressesToValidate[0].Address.CountryCode = "US";
            //
            request.AddressesToValidate[1] = new AddressToValidate();
            request.AddressesToValidate[1].ClientReferenceId = "ClientReferenceId2";
            request.AddressesToValidate[1].Address = new Address();
            request.AddressesToValidate[1].Address.StreetLines = new String[1] { "167 PROSPECT HIGHWAY" };
            request.AddressesToValidate[1].Address.PostalCode = "2147";
            request.AddressesToValidate[1].Address.City = "New SOUTH WALES";
            request.AddressesToValidate[1].Address.CountryCode = "AU";

            request.AddressesToValidate[2] = new AddressToValidate();
            request.AddressesToValidate[2].ClientReferenceId = "ClientReferenceId3";
            request.AddressesToValidate[2].Address = new Address();
            request.AddressesToValidate[2].Address.StreetLines = new String[1] { "20 Tuxedo Court" };
            request.AddressesToValidate[2].Address.PostalCode = "M1G3S5";
            //request.AddressesToValidate[2].Address.City = "Scarborough";
            request.AddressesToValidate[2].Address.StateOrProvinceCode = "ON";
            request.AddressesToValidate[2].Address.CountryCode = "CA";


            request.AddressesToValidate[3] = new AddressToValidate();
            request.AddressesToValidate[3].ClientReferenceId = "ClientReferenceId4";
            request.AddressesToValidate[3].Address = new Address();
            request.AddressesToValidate[3].Address.StreetLines = new String[1] { "135 Liberty St."};
            request.AddressesToValidate[3].Address.PostalCode = "M6K 1A7";
            request.AddressesToValidate[3].Address.City = "Toronto";
            request.AddressesToValidate[3].Address.StateOrProvinceCode = "ON";
            request.AddressesToValidate[3].Address.CountryCode = "CA";
        }
Exemplo n.º 7
0
 /// <remarks/>
 public void addressValidationAsync(AddressValidationRequest AddressValidationRequest)
 {
     this.addressValidationAsync(AddressValidationRequest, null);
 }