Retrieving a WMS service

915
2
Jump to solution
05-21-2014 08:08 AM
DanielNwankwo
New Contributor II
Hello,
I am asking if there is a way to create a WMSLayer from a WMS url.
I am under the following constraints

A) I cannot use the proxy solution as our production infrastructure does not allow outbound communications
B) The WMS URL is not within our network domain, so I am facing 'same site origin policy' issues

Does anyone know of another way to consume an external WMS service.

Secondly, if I do, somehow, get the XML data from the WMS service, is there a way to create the
WMSLayer object by supplying the raw XML data and no URL.

Most appreciated.
Daniel
0 Kudos
1 Solution

Accepted Solutions
RahulMetangale1
Occasional Contributor II
Hi Danoski,

As per ArcGIS JS api documentation of WMS layer class:
"The default behavior of a WMSLayer is to execute a WMS GetCapabilities request, which requires using a proxy page. An alternate approach is to pass a resourceInfo object into the constructor which does not require a GetCapabilities request. "

So if you pass resourceInfo it should not use proxy page.

I hope it helps.

Regards,
Rahul

View solution in original post

0 Kudos
2 Replies
RahulMetangale1
Occasional Contributor II
Hi Danoski,

As per ArcGIS JS api documentation of WMS layer class:
"The default behavior of a WMSLayer is to execute a WMS GetCapabilities request, which requires using a proxy page. An alternate approach is to pass a resourceInfo object into the constructor which does not require a GetCapabilities request. "

So if you pass resourceInfo it should not use proxy page.

I hope it helps.

Regards,
Rahul
0 Kudos
DanielNwankwo
New Contributor II
Hello Rahul,
Thnak you for you help. I can now display the WMS map using the resourseInfo. However if I set the baseMap of my map object to 'streets' the WMS map does not show anymore.

Not sure why that would be, I only have one layer
0 Kudos