GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
geonames works for dev system, 'user does not exist' in production  XML
Forum Index -> General
Author Message
atoma.com.au


[Avatar]

Joined: 09/09/2011 01:11:42
Messages: 1
Offline

Hi,
Our online store has been using geonames to validate worldwide postcodes for years, then it stopped working.

I read about the server switch (we were using ws.geonames.org - now:
-- http://api.geonames.org/postalCodeSearch
I created a username and validated it from the acknowledgement email.

The checker is now working perfectly in the development system but returns an error from our production system.

The response is:

Code:
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <geonames>
 <status message="user does not exist." value="10"/>
 </geonames>


Clearly the request is finding the site, but for some reason, when the production system calls in, the username is rejected. When dev calls in, it is accepted. It is also accepted when I punch it into the browser.

The url and username are both hardcoded, and the source code has not been changed in the production system - it was copied from dev and is identical. I have cleared the caches in the server to the best of my ability.

I have done some experiments through the browser. With no parameters, Geonames returns a different message, so it seems that it is definitely getting the parameters.

Any ideas?

The difference between the two systems is that dev is on Ubuntu Linux in-house and the production system is hosted.

Reorder - replace - remove - replenish your pages
Movable page notebooks from atoma.com.au!
[WWW]
marc



Joined: 08/12/2005 07:39:47
Messages: 4501
Offline

There is probably something wrong with how you make the calls in your production system. Either the username parameter is missing entirely or there are blanks or something that separate the parameter and make it not recognizable for the server.

Best

Marc

[WWW]
AtomaAustralia



Joined: 13/09/2011 09:43:53
Messages: 1
Offline

Found it. Quelle Bizarre...

I was building the query string using
$query="postalcode=$postalcode&country=$country&username=$username"
and the result displayed as totally correct.

I changed it to
$query='postalcode='.$postalcode.'&country='.$country.'&username='.$username
and it works.

Some difference in the encoding used by these two versions of the statement? Who knows. The results in both cases look the same when echoed.
I tried encoding and explicitly converting to unicode - no difference.

Anyhoo, problem averted for now.
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team