Example: XML POST Request & Response

The following is an example of a XML POST request for the Reverse Geocode service.

POST http://myserver:8080/rest/GlobalGeocode/reverseGeocode.xml?
<?xml version="1.0" encoding="UTF-8"?>
<reverseGeocodeRequest>
   <preferences>
      <returnAllCandidateInfo>false</returnAllCandidateInfo>
      <fallbackToGeographic>true</fallbackToGeographic>
      <fallbackToPostal>true</fallbackToPostal>
      <maxReturnedCandidates>1</maxReturnedCandidates>
      <distance>150.0</distance>
      <streetOffset>7.0</streetOffset>
      <cornerOffset>7.0</cornerOffset>
      <matchMode>UNSPECIFIED</matchMode>
      <clientLocale>en-US</clientLocale>
      <clientCoordSysName>epsg:4326</clientCoordSysName>
      <distanceUnits>Meter</distanceUnits>
      <streetOffsetUnits>Meter</streetOffsetUnits>
      <cornerOffsetUnits>Meter</cornerOffsetUnits>
      <mustMatchFields>
         <matchOnAddressNumber>false</matchOnAddressNumber>
         <matchOnPostCode1>false</matchOnPostCode1>
         <matchOnPostCode2>false</matchOnPostCode2>
         <matchOnAreaName1>false</matchOnAreaName1>
         <matchOnAreaName2>false</matchOnAreaName2>
         <matchOnAreaName3>false</matchOnAreaName3>
         <matchOnAreaName4>false</matchOnAreaName4>
         <matchOnAllStreetFields>false</matchOnAllStreetFields>
         <matchOnStreetName>false</matchOnStreetName>
         <matchOnStreetType>false</matchOnStreetType>
         <matchOnStreetDirectional>false</matchOnStreetDirectional>
         <matchOnPlaceName>false</matchOnPlaceName>
         <matchOnInputFields>false</matchOnInputFields>
      </mustMatchFields>
      <returnFieldsDescriptor>
         <returnAllCustomFields>false</returnAllCustomFields>
         <returnMatchDescriptor>false</returnMatchDescriptor>
         <returnStreetAddressFields>false</returnStreetAddressFields>
         <returnUnitInformation>false</returnUnitInformation>
      </returnFieldsDescriptor>
      <customPreferences />
   </preferences>
   <points>
      <country>AUS</country>
      <geometry>
         <type>point</type>
         <coordinates>151.196036</coordinates>
         <coordinates>-33.879637</coordinates>
         <crs>
            <type>name</type>
            <properties>
               <name>EPSG:4326</name>
            </properties>
         </crs>
      </geometry>
   </points>
</reverseGeocodeRequest>

The following shows the XML response returned by the previous request.

<?xml version="1.0" encoding="UTF-8"?>
<GeocodeServiceResponseList>
   <responses>
      <totalPossibleCandidates>2</totalPossibleCandidates>
      <totalMatches>2</totalMatches>
      <candidates>
         <precisionLevel>1</precisionLevel>
         <formattedStreetAddress>
                344 WATTLE CRESCENT
         </formattedStreetAddress>
         <formattedLocationAddress>
                ULTIMO NSW 2007
         </formattedLocationAddress>
         <precisionCode>RS5A</precisionCode>
         <sourceDictionary>0</sourceDictionary>
         <geometry>
            <type>Point</type>
            <coordinates>151.19599158560163</coordinates>
            <coordinates>-33.87967421977337</coordinates>
            <crs>
               <type>name</type>
               <properties>
                  <name>epsg:4326</name>
               </properties>
            </crs>
         </geometry>
         <address>
            <mainAddressLine>344 WATTLE CRESCENT</mainAddressLine>
            <addressLastLine>ULTIMO NSW 2007</addressLastLine>
            <placeName />
            <areaName1>NSW</areaName1>
            <areaName2>COUNCIL OF THE CITY OF SYDNEY</areaName2>
            <areaName3>ULTIMO</areaName3>
            <areaName4 />
            <postCode1>2007</postCode1>
            <postCode2 />
            <country>AUS</country>
            <addressNumber>344</addressNumber>
            <streetName>WATTLE</streetName>
            <customFields>
              <entry>
                 <key 
                     xmlns:xs="http:... 
                     xmlns:xsi="http:... 
                     xsi:type="xs:string">REVERSE_GEOCODE_DISTANCE_UNIT</key>
                 <value 
                     xmlns:xs="http:... 
                     xmlns:xsi="http:...
                     xsi:type="xs:string">METERS</value>
               </entry>
               <entry>
                 <key 
                     xmlns:xs="http:... 
                     xmlns:xsi="http:...
                     xsi:type="xs:string">REVERSE_GEOCODE_DISTANCE</key>
                 <value 
                     xmlns:xs="http:... 
                     xmlns:xsi="http:... 
                     xsi:type="xs:string">1.49</value>
               </entry>
            </customFields>
         </address>
         <ranges>
            <lowHouse>329</lowHouse>
            <highHouse>367</highHouse>
            <side>UNKNOWN</side>
            <oddEvenIndicator>BOTH</oddEvenIndicator>
            <customValues />
         </ranges>
      </candidates>
      <candidates>
         <precisionLevel>1</precisionLevel>
         <formattedStreetAddress>
                344 WATTLE STREET
         </formattedStreetAddress>
         <formattedLocationAddress>
                ULTIMO NSW 2007
         </formattedLocationAddress>
         <precisionCode>RS5A</precisionCode>
         <sourceDictionary>0</sourceDictionary>
         <geometry>
            <type>Point</type>
            <coordinates>151.19599158560163</coordinates>
            <coordinates>-33.87967421977337</coordinates>
            <crs>
               <type>name</type>
               <properties>
                  <name>epsg:4326</name>
               </properties>
            </crs>
         </geometry>
         <address>
            <mainAddressLine>
                 344 WATTLE STREET
             </mainAddressLine>
            <addressLastLine>
                ULTIMO NSW 2007
            </addressLastLine>
            <placeName />
            <areaName1>NSW</areaName1>
            <areaName2>COUNCIL OF THE CITY OF SYDNEY</areaName2>
            <areaName3>ULTIMO</areaName3>
            <areaName4 />
            <postCode1>2007</postCode1>
            <postCode2 />
            <country>AUS</country>
            <addressNumber>344</addressNumber>
            <streetName>WATTLE</streetName>
            <customFields>
              <entry>
                <key 
                    xmlns:xs="http:...
                    xmlns:xsi="http:...
                    xsi:type="xs:string">REVERSE_GEOCODE_DISTANCE_UNIT</key>
                <value 
                    xmlns:xs="http:...
                    xmlns:xsi="http:...
                    xsi:type="xs:string">METERS</value>
              </entry>
              <entry>
                <key
                    xmlns:xs="http:...
                    xmlns:xsi="http:...
                    xsi:type="xs:string">REVERSE_GEOCODE_DISTANCE</key>
                <value
                     xmlns:xs="http:...
                     xmlns:xsi="http:...
                     xsi:type="xs:string">1.49</value>
               lt;/entry>
            </customFields>
         </address>
         <ranges>
            <lowHouse>329</lowHouse>
            <highHouse>367</highHouse>
            <side>UNKNOWN</side>
            <oddEvenIndicator>BOTH</oddEvenIndicator>
            <customValues />
         </ranges>
      </candidates>
   </responses>
</GeocodeServiceResponseList>