GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Unable to use service  XML
Forum Index -> General
Author Message
Tara



Joined: 20/07/2007 04:17:33
Messages: 3
Offline

Hi,

I am new to geonames, so this question might be too simple, plesae just bear with me.

I need to use a GIS library to find post codes from lat/lang. But, I need to call the library from my Server side c# code (i.e. .NET). On top of that I am pressed for time.

Can anyone give me some pointers on how to go about calling the geonames postcode webservice from c#?

Thanks,
Tara
Tara



Joined: 20/07/2007 04:17:33
Messages: 3
Offline

I would also like to know where can i get the WSDL file for the webservices.

Thanks
T
marc



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

Hi Tara

We are using a simple REST type API. This means there are no WSDL files for these kind of web services. It is much simpler and you can even look at what you get in your browser.

There is an article about how to consume a REST web service here :
http://www.apifinder.com/APIFinder/Article/29287

On .NET they write :

n .NET, there is a variety of classes you can use: WebClient, WebRequest, or HttpWebRequest. To send a GET request (suitable for REST), you would use something similar to the following:


string URL = "http://api.flickr.com/services/rest/?method=flickr.people.findByEmail&api_key=" + your_api_key
+ "&find_email="+find_argument;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create (URL);
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
StreamReader reader = new StreamReader(response.GetResponseStream() );
string str = reader.ReadLine();
while(str != null)
{
Console.WriteLine(str);
str = reader.ReadLine();
}
 




Marc

[WWW]
Tara



Joined: 20/07/2007 04:17:33
Messages: 3
Offline

Thanks Marc. Appreciate it.

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