AnsweredAssumed Answered

How to display WMS layer from Geoserver in ArcGIS Javascript API?

Question asked by jcantr1 on Apr 8, 2015
Latest reply on Apr 13, 2015 by reecegrr_grace

I'm having trouble getting a WMS layer from my Geoserver to display in my ArcGIS test application. I'm just learning the ArcGIS Javascript API. For my test application, I started with the "WMS- resource info" sample  https://developers.arcgis.com/javascript/jssamples/layers_wmsresourceinfo.html

 

I basically replaced the WMS layer from the sample with my own:

 

var layer1 = new WMSLayerInfo({

name: 'testSave.0',

title: 'testSave.0'

});

 

var resourceInfo = {

extent: new Extent(-120.77027961360123, 35.79776317148635, -120.74876891832204, 35.812242893139256, {

  wkid: 3857

}),

layerInfos: [layer1]

};

var wmsLayer = new WMSLayer('http://localhost:8040/geoserver/reproj/wms', {

resourceInfo: resourceInfo,

visibleLayers: ['testSave.0']

});

map.addLayers([wmsLayer]);

 

When I run my application, I get the following error message when the WMS layer tries to load:

 

<ServiceExceptionReport xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.3.0" xsi:schemaLocation="http://www.opengis.net/ogc http://localhost:8040/geoserver/schemas/wms/1.3.0/exceptions_1_3_0.xsd">
<ServiceException code="InvalidCRS">
Error occurred decoding the espg code urn:x-ogc:def:crs:EPSG:102100 No code "EPSG:102100" from authority "European Petroleum Survey Group" found for object of type "IdentifiedObject".
</ServiceException>
</ServiceExceptionReport>

 

The problem seems to be related to the spatial reference of the ESRI basemap (ESRI:102100) and my Geoserver's inability to process that spatial reference. I've tried changing the spatial reference of my layer (to EPSG:3857, which I believe is the EPSG equivalent to ESRI:102100). I've also tried adding ESRI:102100 as a custom CRS to my Geoserver, but it added it as EPSG:102100 which is not valid. And both attempts resulted in the same error message.

 

Does anybody know how I could get this layer to display in my application?

Outcomes