I have installed GeoServer and publish one shapefile on it. Now my question is, How can i access that shapefile from GeoServer? and can i work with that resource (shapefile) with ArcGIS API. As we can access any resource from ArcGIS sample server like the code below:

queryTask = new esri.arcgis.gmaps.QueryTask("sampleserver1.arcgisonline.com/ArcGIS/rest/services/…;);

Similarly, which piece of code i need to access my published file from GeoServer ?


GeoServer is serving your shapefile using OGC standards. WMS will send an image of your data while WFS will return the actual data as a vector (encoded in GML by default). Try searching in the ArcGIS help for details of how to import these standards.


The ArcGIS Web API's all support WMS (but not WFS). So the QueryTask will not work with your geoserver).

To use it within the ArcGIS API for JavaScript, use

var wmsLayer = new esri.layers.WMSLayer(YOURURL); 

See the JSAPI resource center for more samples: http://help.arcgis.com/en/webapi/javascript/arcgis/help/jssamples_start.htm


If you want to see the url or download the shapefile from geoserver go to the console and then look at the published datasets. Your set should be there and there should be a whole different set of ways to preview your data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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