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 (http://docs.geoserver.org/stable/en/user/restconfig/rest-config-api.html), 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 want to publish (=layer) and the epgs i want to use.

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

2 Answers 2


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/

  • 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
    Commented Apr 17, 2012 at 22:14
  • 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".
    – ulrich
    Commented Aug 25, 2015 at 7:45
  • If you need a complete guide, go here gis.stackexchange.com/questions/200813/…
    – Magno C
    Commented Jul 7, 2016 at 19:24

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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