GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Java Exception: Please add a username  XML
Forum Index -> General
Author Message
fkunkel



Joined: 02/08/2011 18:04:10
Messages: 3
Offline

Hi,

I'm using the latest jar 1.1.2 and I'm receiving an exception to include my username. I have included this in my code and do not know why it is suddenly not working when it just worked. Are there issues with the servers?

Below is a snippet of the code I'm using for the calls.

Code:
 ToponymSearchCriteria searchCriteria = new ToponymSearchCriteria();
 searchCriteria.setStyle(Style.FULL);
 searchCriteria.setQ(loc.replaceAll("_", " "));
 searchCriteria.setMaxRows(1);
 WebService.setUserName(username);			
 ToponymSearchResult searchResult = WebService
 						.search(searchCriteria);
 
fkunkel



Joined: 02/08/2011 18:04:10
Messages: 3
Offline

I tested my code with the 1.1.1 jar and the code works fine. Is there something different in the 1.1.2 jar that would cause the username not to be passed along?
fkunkel



Joined: 02/08/2011 18:04:10
Messages: 3
Offline

I figured it out. My countryBias had a space in it which was causing the problem. I added the URLEncoder to it and everything works fine now.
 
Forum Index -> General
Go to:   
Powered by JForum 2.1.5 © JForum Team