I posted this on an esri forum but nobody touched it. We've recently updated a geocoding service and I'm now unable to return addresses to my Java application. The old service is built with a 9.3 address locator and is served from a 10.0 ArcGIS Server.
The following code is used to return intersections after the user enters street names.
String url =
MessageFormat.format("{0}/findAddressCandidates?Street={1}%7C{2}&City=&Single+Line+Input=&outFields=&outSR=&f=pjson", geocodeServiceUrl, street, crossStreet);
GetMethod httpGet = new GetMethod(url);
int statusCode = client.executeMethod(httpGet);
The following JSON is returned with the old service:
response={
"spatialReference" : {
"wkid" : 2278
},
"candidates" : [
{
"address" : "EAGER ST | CALLAGHAN AVE",
"location" : {
"x" : 2132338.7499425262,
"y" : 13698061.000045776
},
"score" : 69,
"attributes" : {
}
}
]
}|
However, when I switch to the new service no candidates are returned in the response:
[#|2013-01-09T13:34:51.176-0600|INFO|sun-appserver2.1|null|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-3;|geocodeIntersectionUsingREST: url=same URL/ArcGIS/rest/services/Locators/PWStreets/GeocodeServer/findAddressCandidates?Street=eager%7Ccallaghan&City=&Single+Line+Input=&outFields=&outSR=&f=pjson|#]
[#|2013-01-09T13:34:51.959-0600|INFO|sun-appserver2.1|null|_ThreadID=18;_ThreadName=httpSSLWorkerThread-8080-3;|geocodeIntersectionUsingREST: response={
"spatialReference" : {
"wkid" : 2278
},
"candidates" : [
]
}|#]
Strangely, when we run the same query using the ArcGIS Services directory the correct addresses are returned in JSON. The requests from the app and the services directory are identical. So it seems that only in my Java application and using a 10.0 service and address locator are no results returned.
Until I figure this out we are stuck using the old service built with a 9.3 address locator. Very confused.
Thanks!