GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Please add a username to each call  XML
Forum Index -> General
Author Message
archiejr



Joined: 06/12/2015 12:24:54
Messages: 1
Offline

Hi,

If I run:

Code:
$requestAddress = = 'http://ws.geonames.org/findNearestIntersection?lat=39.7549303&lng=-75.5685421&username=archiejr';
 
  $xml_str = file_get_contents($requestAddress,0);
 
  $xml = new SimplexmlElement($xml_str);
 
 echo '<br /><pre>'.print_r($xml);echo '</pre>';


The following is returned:
SimpleXMLElement Object ( [status] => SimpleXMLElement Object ( [@attributes] => Array ( [message] => Please add a username to each call in order for geonames to be able to identify the calling application and count the credits usage. [value] => 10 ) ) )  


My username has been added to the call. So why the message?
FirstTom



Joined: 08/03/2016 12:42:32
Messages: 1
Offline

archiejr wrote:
Hi,

If I run:

Code:
$requestAddress = = 'http://ws.geonames.org/findNearestIntersection?lat=39.7549303&lng=-75.5685421&username=archiejr';
 
  $xml_str = file_get_contents($requestAddress,0);
 
  $xml = new SimplexmlElement($xml_str);
 
 echo '<br /><pre>'.print_r($xml);echo '</pre>';


The following is returned:
SimpleXMLElement Object ( [status] => SimpleXMLElement Object ( [@attributes] => Array ( [message] => Please add a username to each call in order for geonames to be able to identify the calling application and count the credits usage. [value] => 10 ) ) )  


My username has been added to the call. So why the message? 


I get the same message Archie Jr. I've added my username too. Did you find the solution?

Go here to learn more about Testogen and how it can help you.
justsurf



Joined: 02/04/2016 17:44:27
Messages: 1
Offline

Use this:
Code:
 $link = 'http://api.geonames.org/postalCodeSearch?postalcode='.$pincode.'&maxRows=10&username=xxxx';
 $xml = simplexml_load_string(file_get_contents($link));
 echo $xml->code;
 


CGPA Calculator
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team