Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add an External WMS layer to geoserver with a php page, using the REST service of Geoserver. I've already read the tutorials for creating the geoserver features (, but i couldn't find the way to create a new store and layer with an external wms service.

in other words: i have the url of the external wms service (=store), the layer i wanto to publish (=layer) and the epgs i want to use.

Is there a way to load all of these information in the geoserver schema?

Thank you.

share|improve this question

Unfortunately this is not documented in the api reference or samples. But here is the gist of it.

First create the store:

POST /rest/workspaces/<ws>/wmsstores


And then create the layers:

POST /rest/workspaces/<ws>/wmsstores/wms/wmslayers/

share|improve this answer
Thank you jdeolive for the answer, i'll try to implement this code in my php application. But, i can't figure out how could do that. Can you tell me with more details how can i add this POST code to a php page? Maybe this is a stupid question, but really, i can't figure how to use this REST commands with php – Michele 2 Apr 17 '12 at 22:14
thank you jdeolive! it works! bye – Michele 2 Apr 19 '12 at 11:28
You can add <type>WMS</type> into wmsStore-tag so in the datasources overview in geoserver the type of this datasource gets specified instead of default "?" (applies for geoserver 2.2.3 in my case). I also had to specify header "Content-Type=application/xml". – tareq Aug 25 '15 at 7:45
If you need a complete guide, go here… – Magno C Jul 7 at 19:24

You can also manually configure GeoServer for external WMS layers as explained here.

share|improve this answer

Your Answer


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.