title: Problem with Fedex Address Verification Web Reference
body: <p>I'm trying to get the sample FedEx Address Verification application to work in C#. After contacting my FedEx technical contact and having him activate Address Verification on my test account (apparently it is considered an advanced service that requires additional permissions) I was able to compile and run the example application.</p>
  
  <p>However, I wasn't getting quite the results I expected given the settings...</p>
  
  <pre><code>request.Options.ConvertToUpperCase = true;
  request.Options.CheckResidentialStatus = true;
  </code></pre>
  
  <p>Based on these flags, I expected to have the address come back in upper case, and to be able to check the Residential or ResidentialStatus properties to determine commercial vs residential.  Neither were occuring.</p>
  
  <p>So I installed Fiddler to see the exact SOAP exchange that was taking place and found that the outbound Options tag was not populating except for one property, MaximumNumberOfMatches.</p>
  
  <p>Is there something I should check for in the Reference.cs file that is created by Visual Studio? I didn't see anything out of the norm, but something is happening that is preventing the serialization of some of the properties.</p>
  
  <p>--Edit--</p>
  
  <p>Updated my code as per the suggestion below. Unfortunately, it still only populates 2 of the options parameters. I've included the C# settings code and the outbound/inbound SOAP request below. Can anyone think of a reason the rest of the options are not being sent in the SOAP request?</p>
  
  <pre><code>AddressValidationRequest request = new AddressValidationRequest();
              //
              request.WebAuthenticationDetail = new WebAuthenticationDetail();
              request.WebAuthenticationDetail.UserCredential = new WebAuthenticationCredential();
              request.WebAuthenticationDetail.UserCredential.Key = "XXX-KEY-XXX"; // Replace "XXX" with the Key
              request.WebAuthenticationDetail.UserCredential.Password = "XXX-PWD-XXX"; // Replace "XXX" with the Password
              //
              request.ClientDetail = new ClientDetail();
              request.ClientDetail.AccountNumber = "XXX-ACCT#-XXX"; // Replace "XXX" with client's account number
              request.ClientDetail.MeterNumber = "XXX-MTR#-XXX"; // Replace "XXX" with client's meter number
              //
              request.TransactionDetail = new TransactionDetail();
              request.TransactionDetail.CustomerTransactionId = "***Address Validation v2 Request using VC#***"; // This is just an echo back 
              //
              request.Version = new VersionId(); // Creates the Version element with all child elements populated
              //
              request.RequestTimestamp = DateTime.Now;
              //
              request.Options = new AddressValidationOptions();
              request.Options.CheckResidentialStatus = true;
              request.Options.CheckResidentialStatusSpecified = true;
              request.Options.VerifyAddresses = true;
              request.Options.MaximumNumberOfMatches = "5";
              request.Options.StreetAccuracy = AddressValidationAccuracyType.MEDIUM;
              request.Options.DirectionalAccuracy = AddressValidationAccuracyType.MEDIUM;
              request.Options.CompanyNameAccuracy = AddressValidationAccuracyType.MEDIUM;
              request.Options.ConvertToUpperCase = true;
              request.Options.RecognizeAlternateCityNames = true;
              request.Options.ReturnParsedElements = true;
              //
              request.AddressesToValidate = new AddressToValidate[2];
              request.AddressesToValidate[0] = new AddressToValidate();
              request.AddressesToValidate[0].AddressId = "Kimmel";
              request.AddressesToValidate[0].Address = new Address();
              request.AddressesToValidate[0].Address.StreetLines = new String[1] { "425 Morningside Dr" };
              request.AddressesToValidate[0].Address.City = "Deerfield";
              request.AddressesToValidate[0].Address.PostalCode = "53531";
              request.AddressesToValidate[0].Address.CountryCode = "US";
              //
              request.AddressesToValidate[1] = new AddressToValidate();
              request.AddressesToValidate[1].AddressId = "WD";
              request.AddressesToValidate[1].Address = new Address();
              request.AddressesToValidate[1].Address.StreetLines = new String[1] { "2830 Progress Rd" };
              request.AddressesToValidate[1].Address.PostalCode = "53716";
              request.AddressesToValidate[1].CompanyName = "Wingra Direct";
  </code></pre>
  
  <p>The outbound SOAP Request (obtained using Fiddler). Note the missing options:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;
      &lt;soap:Body&gt;
          &lt;AddressValidationRequest xmlns="http://fedex.com/ws/addressvalidation/v2"&gt;
              &lt;WebAuthenticationDetail&gt;
                  &lt;UserCredential&gt;
                      &lt;Key&gt;XXX-KEY-XXX&lt;/Key&gt;
                      &lt;Password&gt;XXX-PWD-XXX&lt;/Password&gt;
                  &lt;/UserCredential&gt;
              &lt;/WebAuthenticationDetail&gt;
              &lt;ClientDetail&gt;
                  &lt;AccountNumber&gt;XXX-ACCT#-XXX&lt;/AccountNumber&gt;
                  &lt;MeterNumber&gt;XXX-MTR#-XXX&lt;/MeterNumber&gt;
              &lt;/ClientDetail&gt;
              &lt;TransactionDetail&gt;
                  &lt;CustomerTransactionId&gt;***Address Validation v2 Request using VC#***&lt;/CustomerTransactionId&gt;
              &lt;/TransactionDetail&gt;
              &lt;Version&gt;
                  &lt;ServiceId&gt;aval&lt;/ServiceId&gt;
                  &lt;Major&gt;2&lt;/Major&gt;
                  &lt;Intermediate&gt;0&lt;/Intermediate&gt;
                  &lt;Minor&gt;0&lt;/Minor&gt;
              &lt;/Version&gt;
              &lt;RequestTimestamp&gt;2010-08-26T16:40:13.2026134-05:00&lt;/RequestTimestamp&gt;
              &lt;Options&gt;
                  &lt;CheckResidentialStatus&gt;true&lt;/CheckResidentialStatus&gt;
                  &lt;MaximumNumberOfMatches&gt;5&lt;/MaximumNumberOfMatches&gt;
              &lt;/Options&gt;
              &lt;AddressesToValidate&gt;
                  &lt;AddressId&gt;Kimmel&lt;/AddressId&gt;
                  &lt;Address&gt;
                      &lt;StreetLines&gt;425 Morningside Dr&lt;/StreetLines&gt;
                      &lt;City&gt;Deerfield&lt;/City&gt;
                      &lt;PostalCode&gt;53531&lt;/PostalCode&gt;
                      &lt;CountryCode&gt;US&lt;/CountryCode&gt;
                      &lt;Residential&gt;true&lt;/Residential&gt;
                  &lt;/Address&gt;
              &lt;/AddressesToValidate&gt;
              &lt;AddressesToValidate&gt;
                  &lt;AddressId&gt;WD&lt;/AddressId&gt;
                  &lt;CompanyName&gt;Wingra Direct&lt;/CompanyName&gt;
                  &lt;Address&gt;
                      &lt;StreetLines&gt;2830 Progress Rd&lt;/StreetLines&gt;
                      &lt;PostalCode&gt;53716&lt;/PostalCode&gt;
                  &lt;/Address&gt;
              &lt;/AddressesToValidate&gt;
          &lt;/AddressValidationRequest&gt;
      &lt;/soap:Body&gt;
  &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>The response I get back is:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;env:Header xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"/&gt;
      &lt;soapenv:Body&gt;
          &lt;v2:AddressValidationReply xmlns:v2="http://fedex.com/ws/addressvalidation/v2"&gt;
              &lt;v2:HighestSeverity&gt;SUCCESS&lt;/v2:HighestSeverity&gt;
              &lt;v2:Notifications&gt;
                  &lt;v2:Severity&gt;SUCCESS&lt;/v2:Severity&gt;
                  &lt;v2:Source&gt;wsi&lt;/v2:Source&gt;
              &lt;/v2:Notifications&gt;
              &lt;v2:TransactionDetail xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
                  &lt;v2:CustomerTransactionId&gt;***Address Validation v2 Request using VC#***&lt;/v2:CustomerTransactionId&gt;
              &lt;/v2:TransactionDetail&gt;
              &lt;v2:Version xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"&gt;
                  &lt;v2:ServiceId&gt;aval&lt;/v2:ServiceId&gt;
                  &lt;v2:Major&gt;2&lt;/v2:Major&gt;
                  &lt;v2:Intermediate&gt;0&lt;/v2:Intermediate&gt;
                  &lt;v2:Minor&gt;0&lt;/v2:Minor&gt;
              &lt;/v2:Version&gt;
              &lt;v2:ReplyTimestamp&gt;2010-08-26T21:40:14.140Z&lt;/v2:ReplyTimestamp&gt;
              &lt;v2:AddressResults&gt;
                  &lt;v2:AddressId&gt;Kimmel&lt;/v2:AddressId&gt;
                  &lt;v2:ProposedAddressDetails&gt;
                      &lt;v2:Score&gt;93&lt;/v2:Score&gt;
                      &lt;v2:Changes&gt;MODIFIED_TO_ACHIEVE_MATCH&lt;/v2:Changes&gt;
                      &lt;v2:ResidentialStatus&gt;UNAVAILABLE&lt;/v2:ResidentialStatus&gt;
                      &lt;v2:DeliveryPointValidation&gt;CONFIRMED&lt;/v2:DeliveryPointValidation&gt;
                      &lt;v2:Address&gt;
                          &lt;v2:StreetLines&gt;425 Morningside Dr&lt;/v2:StreetLines&gt;
                          &lt;v2:City&gt;Deerfield&lt;/v2:City&gt;
                          &lt;v2:StateOrProvinceCode&gt;WI&lt;/v2:StateOrProvinceCode&gt;
                          &lt;v2:PostalCode&gt;53531-9492&lt;/v2:PostalCode&gt;
                          &lt;v2:CountryCode&gt;US&lt;/v2:CountryCode&gt;
                      &lt;/v2:Address&gt;
                      &lt;v2:RemovedNonAddressData/&gt;
                  &lt;/v2:ProposedAddressDetails&gt;
              &lt;/v2:AddressResults&gt;
              &lt;v2:AddressResults&gt;
                  &lt;v2:AddressId&gt;WD&lt;/v2:AddressId&gt;
                  &lt;v2:ProposedAddressDetails&gt;
                      &lt;v2:Score&gt;93&lt;/v2:Score&gt;
                      &lt;v2:Changes&gt;MODIFIED_TO_ACHIEVE_MATCH&lt;/v2:Changes&gt;
                      &lt;v2:ResidentialStatus&gt;UNAVAILABLE&lt;/v2:ResidentialStatus&gt;
                      &lt;v2:DeliveryPointValidation&gt;CONFIRMED&lt;/v2:DeliveryPointValidation&gt;
                      &lt;v2:CompanyName&gt;Wingra Direct&lt;/v2:CompanyName&gt;
                      &lt;v2:Address&gt;
                          &lt;v2:StreetLines&gt;2830 Progress Rd&lt;/v2:StreetLines&gt;
                          &lt;v2:City&gt;Madison&lt;/v2:City&gt;
                          &lt;v2:StateOrProvinceCode&gt;WI&lt;/v2:StateOrProvinceCode&gt;
                          &lt;v2:PostalCode&gt;53716-3338&lt;/v2:PostalCode&gt;
                          &lt;v2:CountryCode&gt;US&lt;/v2:CountryCode&gt;
                      &lt;/v2:Address&gt;
                      &lt;v2:RemovedNonAddressData/&gt;
                  &lt;/v2:ProposedAddressDetails&gt;
              &lt;/v2:AddressResults&gt;
          &lt;/v2:AddressValidationReply&gt;
      &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>