Chapter 1.3 - Sample Messages

Geocoding requests through AFC Geo SaaS Pro Soap are made using SOAP messages, with each message written in XML. Examples of both types of bindings are provided here to help you understand what should be sent to the service.

Your First Address Geocoding Request

We’re going to send a simple GetServerTime request using Postman and then inspect the results. Examples for both the Basic HTTP Binding and Custom Binding are provided here.

Headers

Add these headers to your request:

  • Content-Type: text/xml
  • SOAPAction: http://tempuri.org/ILocatorService/GetServerTime

The SOAPAction value is updated based on the method you are using.

Postman example

Body

For the body of the GetServerTime request, copy and paste this example and update with your Username and Password:

Basic HTTP Binding Example

Request

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" xmlns:s="s">
   <soapenv:Header>
      <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <o:UsernameToken>
            <o:Username>USERNAME</o:Username>
            <o:Password>PASSWORD</o:Password>
         </o:UsernameToken>
      </o:Security>
   </soapenv:Header>
   <soapenv:Body>
      <tem:GetServerTime/>
   </soapenv:Body>
</soapenv:Envelope>

Response

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
   <s:Header>
      <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <u:Timestamp u:Id="_0">
            <u:Created>2019-01-29T19:54:40.527Z</u:Created>
            <u:Expires>2019-01-29T19:59:40.527Z</u:Expires>
         </u:Timestamp>
      </o:Security>
   </s:Header>
   <s:Body>
      <GetServerTimeResponse xmlns="http://tempuri.org/">
         <GetServerTimeResult>Jan 29, 2019 7:54:40 PM</GetServerTimeResult>
      </GetServerTimeResponse>
   </s:Body>
</s:Envelope>

Custom Binding Example

Request

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/" xmlns:s="s">
   <soap:Header>
      <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
         <o:UsernameToken>
            <o:Username>USERNAME</o:Username>
            <o:Password>PASSWORD</o:Password>
         </o:UsernameToken>
      </o:Security>
   </soap:Header>
   <soap:Body>
      <tem:GetServerTime/>
   </soap:Body>
</soap:Envelope>

Response

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
   <s:Body>
      <GetServerTimeResponse xmlns="http://tempuri.org/">
         <GetServerTimeResult>Jan 29, 2019 7:54:40 PM</GetServerTimeResult>
      </GetServerTimeResponse>
   </s:Body>
</s:Envelope>

For more sample requests, see Customizing Geocoding Requests.

Sample code for other languages, such as C# and Java, can be found on GitHub.