I'm trying to use WMSLayer (https://developers.arcgis.com/javascript/3/jsapi/wmslayer-amd.html) to create a layer from a WMS file. However, the class makes a call to https://www.geoservicos.ide.df.gov.br/arcgis/services/Publico/CADASTRO_TERRITORIAL/MapServer/WMSServer/1.0.0/WMTSCapabilities.xml and this url is returning:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
<ServiceExceptionReport version="1.1.1">
   <ServiceException code="RequestNotAllowed">
The request not allowed.

Doing some tests I found that there is the url https://www.geoservicos.ide.df.gov.br/arcgis/services/Publico/CADASTRO_TERRITORIAL/MapServer/WMSServer?service=WMS&request=GetCapabilities and this one does return an XML, but is not formatted the way the library needs to do the parser (it doesn't have the contents tag). Returning the following error:

The WMTS capabilities XML is not valid

Can anyone help me with this?

  • Those services do not answer for me, but please notice that in your latter request you are accessing a WMS service and therefore the capabilities XML is not valid for a WMTS layer.
    – user30184
    Commented Mar 3, 2023 at 7:01

1 Answer 1


A WMS GetCapabilities response never has a contents tag; there's no such element defined by the WMS standard (for example see http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd).

The contents element (tag) is part of the WMTS standard

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.