I have an application that uses WebObjects to send an XML request to Melissa in order to get location data given an address. The response accurately provides things like the delivery point code and delivery point check digit. The request is sent like so, using the request XML for the value of s
:
NSData requestContent = new NSData(s.toString().getBytes());
WORequest request = new WORequest("GET", "/xml.asp", "HTTP/1.1", null, requestContent, null);
WOHTTPConnection httpConnection = new WOHTTPConnection("xml.melissadata.com", 80);
httpConnection.setReceiveTimeout(1000 * 10); // wait only 10 seconds
// for response
if (httpConnection.sendRequest(request)) {
As an example, I can send the following XML request to look up the address 3510 Marvin Rd NE, Olympia, WA:
<?xml version="1.0" ?>
<RecordSet>
<CustomerID>[some ID]</CustomerID>
<Record><Company/>
<Address>3510 Marvin Rd NE</Address>
<Address2/>
<City>Lacey</City>
<State>WA</State>
<Zip/>
<Plus4/>
<Latitude/>
<Longitude/>
<CarrierRoute/>
<DeliveryPointCode/>
<DeliveryPointCheckDigit/>
<AddressTypeCode/>
</Record>
<ErrorString/>
</RecordSet>
...and I get the following XML response from Melissa:
<Company></Company>
<Address>3510 Marvin Rd NE</Address>
<Address2></Address2>
<City>Lacey</City>
<State>WA</State>
<Zip>98516</Zip>
<Plus4>1423</Plus4>
<Latitude/>
<Longitude/>
<CarrierRoute>C082</CarrierRoute>
<DeliveryPointCode>10</DeliveryPointCode>
<DeliveryPointCheckDigit>0</DeliveryPointCheckDigit>
<AddressTypeCode>S</AddressTypeCode>
It seems to get all of the correct location information that I'm interested in except for Latitude and Longitude. In the tutorials I've looked at for Melissa XML requests, everything seems to be formatted the same way I have it, and in this Melissa example app, I'm able to get correct latitude and longitude data using the same test address. I've also tried putting in dummy values for latitude and longitude with the request, but these end up being unchanged. How can I format my request so that the response will give me latitude and longitude?