Address Validation Integration

Certified Associate Developer

Hi all,

I am using an integration with usps to verify the address.  I am using the following URL in integration:

https://servername/ShippingAPI.dll?API=Verify&XML=

After this I need to pass the XML request  which should be in the following form and sequence:

<AddressValidateRequest USERID="XXXXX">

<Revision>1</Revision>

<Address ID="0">

   <Address1></Address1>

   <Address2>29851 Aventura #k</Address2>

   <City></City>

   <State>CA</State>

   <Zip5>92688</Zip5>

   <Zip4></Zip4>

</Address>

</AddressValidateRequest>

When I try to send the request, I am getting the following error:

<Error><Number>80040B19</Number><Description>XML Syntax Error: Please check the XML request to see if it can be parsed.</

I am using toxml function in body and as follows:

toxml(
  value: {
    "AddressValidateRequest USERID": "XXXXX",
    "Address ID": "0",
    "Address1": "14910",
    "Address2": "Jockeys Ridge",
    "City": "Charlotte",
    "State": "NC",
    "Zip5":"28277"
  }
)

Where am I going wrong?  Thanks in advance.

  Discussion posts and replies are publicly visible

Parents
  • Hi Brinda, I tried some thing like this,
    Create a CDT of type Address with your required address fields like address1, address2,city,state,zip code etc.
    Create one more CDT of type AddressValidateRequest with the following fields
    1.Revision
    2.AddressID
    3.Address< of type Address [Array]>

    Now use the toxml function. hope this will be helpful
    toxml(
    value: ri!AddressValidateRequest,
    format:true
    )
    Hope this will be help ful
Reply
  • Hi Brinda, I tried some thing like this,
    Create a CDT of type Address with your required address fields like address1, address2,city,state,zip code etc.
    Create one more CDT of type AddressValidateRequest with the following fields
    1.Revision
    2.AddressID
    3.Address< of type Address [Array]>

    Now use the toxml function. hope this will be helpful
    toxml(
    value: ri!AddressValidateRequest,
    format:true
    )
    Hope this will be help ful
Children