I'm looking to do a lookup for a non-cached item on a geonamesId using the get webservice. Since it doesn't exist, I'm trying my hand at implementing it.
$config['get'] = array(
'service_name' => 'get',
'service_full_name' => 'Get using geonameId',
'description' => 'Find Geoname using geonameId',
'service_path' => 'get',
'credit_cost' => 1,
'result_cache_prefix' => 'getres:',
'data_cache_prefix' => 'getdat:',
'allowed_parameters' => array(
'geonameid' => 'geonameId',
'style' => 'style'
),
'columns' => array(
'name',
'lat',
'long',
'geonameId',
'countryCode',
),
);
The while the webservice returns data, the Geonames module does not correctly parse the XML result. I suspect in part it has to do with totalResultsCount not returned in the XML for the get service. The XML traversal appears to be ok, though I haven't tested it explicitly against the result set with one less parent node.
Comments
Comment #1
aurevo1r commentedAlso, here's the result of a
getquery.Comment #2
2xe commentedHi,
The 'get' service is structured diffently than the others -- so the current parser won't be able to produce the proper output. I have actually implemented this service myself, but not tested it properly yet. Here's a custom parser for the get service;
My service config looks like this:
..and you will have to trigger the proper parser - change
to
I'm unsure if this is complete -- I've just copied and pasted from my dev-version. (I wasn't aware of the style parameter.. just add it like you did so any queries using this won't fail.)....
Have a nice day!
Sero
Comment #3
2xe commentedComment #4
aurevo1r commentedThanks. I'll try it out and report any issues I have with the patch and if I can, implement a fix.
Comment #5
Anonymous (not verified) commentedHere's a patch of SeroSero's changes. Seems to work alright, though haven't tested everything...
Comment #6
lyricnz commentedFixed in http://drupal.org/cvs?commit=262756