I have couple of questions.

  1. var wmsLayer = new esri.layers.WMSLayer(wmsURL); with this line of code i can display wms layer over any base Layer. Now From where I get wmsURL ? I have published my shapefile on GeoServer, but i dont know how i get the URL (wmsURL) to use as parameter in above line of code ?

  2. Now, Let's suppose I am successful to display wmsLayer. Now i want to query data against this wmsLayer. Like code below:

queryTask = new esri.tasks.QueryTask("wmsURL"); Can I use wmsURL as a parameter in QueryTask method ? From ArcGIS API reference, I come to know that the URL parameter of QueryTask method is the URL to the ArcGIS Server REST resource. But as u know i am using GeoServer, so how it could be fixed. Need some explanation ?

3 Answers 3


You need to check the documentation for esri.layers.WMSLayer to see what sort of URL it requires. It might be a getcapabilities request so something like http://ian01.geog.psu.edu/geoserver/ows?service=wms&version=1.1.1&request=GetCapabilities or may be it is a complete getmap request http://ian01.geog.psu.edu/geoserver/wms?LAYERS=topp%3Astates&STYLES=&FORMAT=image%2Fpng&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&SRS=EPSG%3A4326&BBOX=-139.84813671875,18.549615234375,-51.85286328125,55.778384765625&WIDTH=780&HEIGHT=330 or may be it is some subset of this (i.e. the program can fill in the sizes or format)?


Q1. The wmsURL would probably be something like http://www.myserver.com/geoserver203/wms

Q2. It's not possible to use the QueryTask to query a geoserver.


It would normally be something like http://mydomain.com/ArcGIS/services/mylayerservicename/MapServer/WMSServer
where you supply the domain and servicename.

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.