0

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?

user3726962
  • 333
  • 1
  • 4
  • 17
  • 1
    You'll get more help if you give actual input and output. You could pick any address that you like. I work with address customers all day long and it is definitely easier to eliminate problems if I know exactly what you are submitting. – Jeffrey Aug 15 '17 at 14:53
  • @Jeffrey Thanks, I added an example address and verified that it gives the correct coordinates when I try plugging in it at the URL I linked. – user3726962 Aug 15 '17 at 17:23

1 Answers1

0

As it turned out, the problem had to do with the subscription to Melissa. It was solved by upgrading the subscription so that it would be possible to get latitude and longitude from XML queries.

user3726962
  • 333
  • 1
  • 4
  • 17