<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to add WMS Service to Map. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-add-wms-service-to-map/m-p/360782#M33420</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to add a WMS service to map. The functionality is to add any WMS service to map by using the url provided by user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am facing various errors as below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before starting with the issue, I would like to explain the procedure I am following to create and add a WMS Service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Sending request to WMS service as below, to run "GetCapabilities" task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Sending request to the WMS Service by appending "?service=WMS&amp;amp;request=GetCapabilities".&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;To send request I am using "dojo/request"; "dojo/request/xhr", "esri/request" and also tried with XMLHttpRequest&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;SPAN&gt;At this stage, i am getting correct response only in IE. In Chrome and FireFox i am getting errors as below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mozilla: 407 Proxy Authentication required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chrome: No "Access-Control-Allow-Origin" header is present on the requested resource. Origin 'http:localhost:&amp;lt;port&amp;gt;' is therefore not allowed access.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IE: works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. From the response of the above request, I am constructing, an array for VisibleLayers and creating object for the WMS Layer as below..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var wmsLayer = new WMSLayer(wmsUrl, {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayers: visibleLayersArray&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and adding it to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. I attached "layer-add-result" event to map to zoom to the layer when the layer is added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For some services, in this event, i am getting "error" in evt object. saying "GetCapabilities" request is failed. (I am using Proxy page)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4. And for some layers, there is no error object in evt object. However, nothing is visible on map. When i am panning or zooming and observed the req/response in fiddler and got the below error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;-&amp;lt;ServiceExceptionReport xsi:schemaLocation="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.opengis.net/ogc" rel="nofollow" target="_blank"&gt;http://www.opengis.net/ogc&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd" rel="nofollow" target="_blank"&gt;http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;&lt;SPAN&gt;" xmlns="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.opengis.net/ogc" rel="nofollow" target="_blank"&gt;http://www.opengis.net/ogc&lt;/A&gt;&lt;SPAN&gt;" version="1.3.0"&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ServiceException code="LayerNotDefined"&amp;gt; msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings. &amp;lt;/ServiceException&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ServiceExceptionReport&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could some one please help me in solving this. I don't want to use resourceInfo object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jun 2014 11:58:04 GMT</pubDate>
    <dc:creator>VivekPrasad</dc:creator>
    <dc:date>2014-06-30T11:58:04Z</dc:date>
    <item>
      <title>Unable to add WMS Service to Map.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-add-wms-service-to-map/m-p/360782#M33420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Everyone,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to add a WMS service to map. The functionality is to add any WMS service to map by using the url provided by user.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am facing various errors as below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Before starting with the issue, I would like to explain the procedure I am following to create and add a WMS Service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Steps:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. Sending request to WMS service as below, to run "GetCapabilities" task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;Sending request to the WMS Service by appending "?service=WMS&amp;amp;request=GetCapabilities".&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;To send request I am using "dojo/request"; "dojo/request/xhr", "esri/request" and also tried with XMLHttpRequest&lt;/LI&gt;&lt;BR /&gt;&lt;/OL&gt;&lt;SPAN&gt;At this stage, i am getting correct response only in IE. In Chrome and FireFox i am getting errors as below.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mozilla: 407 Proxy Authentication required.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Chrome: No "Access-Control-Allow-Origin" header is present on the requested resource. Origin 'http:localhost:&amp;lt;port&amp;gt;' is therefore not allowed access.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IE: works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. From the response of the above request, I am constructing, an array for VisibleLayers and creating object for the WMS Layer as below..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; var wmsLayer = new WMSLayer(wmsUrl, {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; visibleLayers: visibleLayersArray&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;and adding it to the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;3. I attached "layer-add-result" event to map to zoom to the layer when the layer is added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For some services, in this event, i am getting "error" in evt object. saying "GetCapabilities" request is failed. (I am using Proxy page)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;4. And for some layers, there is no error object in evt object. However, nothing is visible on map. When i am panning or zooming and observed the req/response in fiddler and got the below error.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;?xml version="1.0" encoding="ISO-8859-1"?&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;SPAN&gt;-&amp;lt;ServiceExceptionReport xsi:schemaLocation="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.opengis.net/ogc" rel="nofollow" target="_blank"&gt;http://www.opengis.net/ogc&lt;/A&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd" rel="nofollow" target="_blank"&gt;http://schemas.opengis.net/wms/1.3.0/exceptions_1_3_0.xsd&lt;/A&gt;&lt;SPAN&gt;" xmlns:xsi="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.w3.org/2001/XMLSchema-instance" rel="nofollow" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;&lt;SPAN&gt;" xmlns="&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.opengis.net/ogc" rel="nofollow" target="_blank"&gt;http://www.opengis.net/ogc&lt;/A&gt;&lt;SPAN&gt;" version="1.3.0"&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;ServiceException code="LayerNotDefined"&amp;gt; msWMSLoadGetMapParams(): WMS server error. Invalid layer(s) given in the LAYERS parameter. A layer might be disabled for this request. Check wms/ows_enable_request settings. &amp;lt;/ServiceException&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;lt;/ServiceExceptionReport&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/HTML]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Could some one please help me in solving this. I don't want to use resourceInfo object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 11:58:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-add-wms-service-to-map/m-p/360782#M33420</guid>
      <dc:creator>VivekPrasad</dc:creator>
      <dc:date>2014-06-30T11:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to add WMS Service to Map.</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-add-wms-service-to-map/m-p/360783#M33421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could fix this issue.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 11:54:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/unable-to-add-wms-service-to-map/m-p/360783#M33421</guid>
      <dc:creator>VivekPrasad</dc:creator>
      <dc:date>2014-07-01T11:54:47Z</dc:date>
    </item>
  </channel>
</rss>

