Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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!

share|improve this question
    
Is my answer completely off target -- I'm curious if it is the parameter naming? –  awesomo Jan 26 '13 at 2:18
add comment

1 Answer

This so stupid on Esri, but try "SingleLine" instead "Single+Line+Input" and let me know. I've sent a update documentation request on this and they said some versions still use it,.. but not in 10 an 10.1. Btw, who makes a service parameter with spaces?!

Check the other parameters names as well. Compare them to what the html form is sending with with URL with GET request or POST use Fiddler or Firefox Net Pane.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.