CalculateDistance

CalculateDistance takes two sets of latitude/longitude coordinates as input, calculates the distance between the coordinates, and returns the distance between the two points.

CalculateDistance is part of the Enterprise Tax Module.

Resource URL

http://server:port/soap/CalculateDistance

Example

The following shows a SOAP request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cal="http://www.pb.com/spectrum/services/CalculateDistance" xmlns:spec="http://spectrum.pb.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <cal:CalculateDistanceRequest>
         <spec:options>
            <cal:LatLongFormat>Decimal</cal:LatLongFormat>
         </spec:options>
         <cal:input_port>
            <cal:Coordinates>
               <cal:FirstLatitude>41.857333</cal:FirstLatitude>
               <cal:FirstLongitude>-88.325183</cal:FirstLongitude>
               <cal:SecondLatitude>41.881833</cal:SecondLatitude>
               <cal:SecondLongitude>-87.785587</cal:SecondLongitude>
            </cal:Coordinates>
         </cal:input_port>
      </cal:CalculateDistanceRequest>
   </soapenv:Body>
</soapenv:Envelope>

This would be the response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns3:CalculateDistanceResponse xmlns:ns2="http://spectrum.pb.com/"
      xmlns:ns3="http://www.pb.com/spectrum/services/CalculateDistance">
         <ns3:output_port>
            <ns3:Result>
               <ns3:Distance>27.799</ns3:Distance>
               <ns3:user_fields/>
            </ns3:Result>
         </ns3:output_port>
      </ns3:CalculateDistanceResponse>
   </soap:Body>
</soap:Envelope>