Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am currently experimenting with Geoserver and it's capabilities within C#. One thing I would like to do is query the server for basic information (existing workspaces, layers, layer attributes, etc...)

I noticed that Geoserver does have a REST implementation, but is there a C# implementation for consuming this service? I am sure a library could easily be written, but I would hate to re-invent the wheel if one already exists. Thank you!

Edit

This can be done using C# WebRequests. However, what I would have created is a C# library for consuming the Geoserver REST implementation. It seems like something many people would use. Another way to ask the question would be, "Does a library full of C# WebRequests exist to consume Geoserver's REST implementation?"

It is much easier if a library already exists with classes such as these to consume the webservice, than it is to create an entire library. For Example:

var geoserver = new Geoserver("http://localhost:8080/geoserver/web");
var workSpaces = geoserver.Workspaces;
var layer = geoserver.Workspaces[0].Layers["Foo"];

The above code is the type of implementation I would really enjoy. If I was to create a library that consumed the Geoserver REST service. The above is what I would create for myself to use. If it wasn't created already, I would likely make an opensource project that others could use as well. So that in the future, if someone is wanting a library to easily consume the Geoserver service, they can contribute and use the one that already exists! :)

share|improve this question
1  
Why do you need an API? If it's a simple REST (url-based) API that you need to hit, then you could use a WebRequest object to request msdn.microsoft.com/en-us/library/456dfw4f or submit msdn.microsoft.com/en-us/library/debx8sh9 data –  Vadim Jul 16 '12 at 16:43
1  
@Vadim Yes, this can be done. See Edit. I am trying not to re-invent the wheel. –  jsmith Jul 16 '12 at 17:04
1  
Ask yourself this, do you know of an API to call ANY web services? No, because the web service IS THE API. What you might want to consider asking is: how do I generate proxy classes from Geoserver web services? –  CaptDragon Jul 16 '12 at 17:08
2  
I think it is a perfectly reasonable question to ask whether a .NET wrapper library exists for the Geoserver API. It does not seem to be the case though. If you are willing to implement it yourself and share your work, I suggest that you put it on GitHub. Other people might contribute to your project easily. –  Petr Krebs Jul 16 '12 at 20:38
1  
+1 I agree with @PetrKrebs . It would be interesting to see wrappers that leverage async and await introduced in C# 5. –  Kirk Kuykendall Jul 17 '12 at 12:44

2 Answers 2

I use RESTSHARP for communicating with many REST web services. Makes everything a lot easier.

share|improve this answer
    
I like RESTSHARP as well. If I do have to implement this myself, it is what I will be using to implement it. –  jsmith Jul 16 '12 at 17:22
    
To add to what I am asking. I am not after a library that helps consume REST services. I am asking for a library that has been written as a wrapper to consume specifically geoserver REST services. –  jsmith Jul 16 '12 at 17:34
1  
That is, something like code.google.com/p/geoserver-manager, which is for Java, and there are equivalents for Python and Ruby, but to my knowledge, nothing for C# –  Andrea Aime Jul 16 '12 at 18:59

I think it is a perfectly reasonable question to ask, no-one wants to reinvent the wheel. I had a similar requirement on a project and I too could not find a C# assembly that would make working with GeoServer easier.

In the end I created a class within my project to simplify the REST calls to/from GeoServer but it was specifically tuned to my needs. I would happily contribute to an Open Source project to create a C# management assembly for GeoServer.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.