<?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 Re: Chrome, WMS and content-type application/vnd.ogc.wms_xml fails.. in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449129#M41485</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just encountered this problem as well, and fortunately found this thread that clarified what the cause was. Since I need to use a proxy for the GetCapabilities request, I've just edited the proxy so that a ContentType of 'application/vnd.ogc.wms_xml' with 'text/xml' before the response is returned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're using the current DotNet version of the resource-proxy Esri has hosted on GitHub (&lt;/SPAN&gt;&lt;A href="https://github.com/Esri/resource-proxy" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Esri/resource-proxy&lt;/A&gt;&lt;SPAN&gt;), you can make this change near the start of the fetchAndPassBackToClient method in the proxy.ashx file (around line 293):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private bool fetchAndPassBackToClient(System.Net.WebResponse serverResponse, HttpResponse clientResponse, bool ignoreAuthenticationErrors) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (serverResponse != null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: &amp;quot;#FF0000&amp;quot;;"&gt;if (serverResponse.ContentType == "application/vnd.ogc.wms_xml") clientResponse.ContentType = "text/xml";
 else clientResponse.ContentType = serverResponse.ContentType;&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (Stream byteStream = serverResponse.GetResponseStream()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 20:03:23 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-12-11T20:03:23Z</dc:date>
    <item>
      <title>Chrome, WMS and content-type application/vnd.ogc.wms_xml fails..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449126#M41482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I'm using Esri js api 3.7 and "esri/layers/WMSLayer" to add WMS layers to my map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The WMS GetCapabilities response has content-type &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;application/vnd.ogc.wms_xml&lt;/SPAN&gt;&lt;SPAN&gt; (from MapServer).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;In Chrome (v. 31.x) the xhr object returns null, and not the xml document. It works fine in FireFox. So the capability xml file is not loaded, and the wms does not show up in the map.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It seems like Chrome does not handle the response as text/xml, and instead returns null.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I change the response content-type from application/vnd.ogc.wms_xml to text/xml (using Fiddler), it also works in Chrome.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Has anyone else have experiences this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found 2 workarounds:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;1) Create an resourceInfo object(optional parameter in creating wms layer). This prevents the GetCapabilities request.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; There are many services and layers, so this is not an prefered option..&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2) Use my own old custom WMS-layer object(inherit esri/layers/TiledMapServiceLayer). It does not ask for GetCapabilities.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any other tips/workarounds? &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should the Esri js api handle this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;-Endre&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 07:54:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449126#M41482</guid>
      <dc:creator>EndreStokseth</dc:creator>
      <dc:date>2013-12-04T07:54:39Z</dc:date>
    </item>
    <item>
      <title>Re: Chrome, WMS and content-type application/vnd.ogc.wms_xml fails..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449127#M41483</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 have the exact same problem.&amp;nbsp; The service I'm accessing is the public NOAA nowCOAST mapping service:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs"&gt;http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It returns its responses using Content-Type: application/vnd.ogc.wms_xml&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The layers work in IE and Firefox, but in chrome, I get the error message:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;"GetCapabilities request for &lt;/SPAN&gt;&lt;A href="http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs"&gt;http://nowcoast.noaa.gov/wms/com.esri.wms.Esrimap/obs&lt;/A&gt;&lt;SPAN&gt; failed. (Response is null.)"&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is very frustrating.&amp;nbsp; The only workaround we have right now is to manually create an ajax request, parse the data and create a matching resource info object.&amp;nbsp; I don't want to have to do this.&amp;nbsp; Does anybody have a solution for this problem?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Jan 2014 21:49:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449127#M41483</guid>
      <dc:creator>DavidElies</dc:creator>
      <dc:date>2014-01-14T21:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Chrome, WMS and content-type application/vnd.ogc.wms_xml fails..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449128#M41484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you solve it? I have a similar problem. But in my case depends on the size of the wms, i think..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Galicia: This one contains WMS from Galicia (north of Spain) and it loads correctly on Firefox and Chrome. Right&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://signo-geo.com/alejandrowms/mapacorrecto2.html"&gt;http://signo-geo.com/alejandrowms/mapacorrecto2.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Andalucia (south of Spain): Here is the problem, because the WMS on Chrome is not loading and I don't know why but in Firefox it works fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://signo-geo.com/alejandrowms/mapaprueba2.html"&gt;http://signo-geo.com/alejandrowms/mapaprueba2.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 12 Feb 2014 22:15:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449128#M41484</guid>
      <dc:creator>AlejandroGonzález_Santiuste</dc:creator>
      <dc:date>2014-02-12T22:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Chrome, WMS and content-type application/vnd.ogc.wms_xml fails..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449129#M41485</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I just encountered this problem as well, and fortunately found this thread that clarified what the cause was. Since I need to use a proxy for the GetCapabilities request, I've just edited the proxy so that a ContentType of 'application/vnd.ogc.wms_xml' with 'text/xml' before the response is returned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you're using the current DotNet version of the resource-proxy Esri has hosted on GitHub (&lt;/SPAN&gt;&lt;A href="https://github.com/Esri/resource-proxy" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Esri/resource-proxy&lt;/A&gt;&lt;SPAN&gt;), you can make this change near the start of the fetchAndPassBackToClient method in the proxy.ashx file (around line 293):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;private bool fetchAndPassBackToClient(System.Net.WebResponse serverResponse, HttpResponse clientResponse, bool ignoreAuthenticationErrors) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (serverResponse != null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: &amp;quot;#FF0000&amp;quot;;"&gt;if (serverResponse.ContentType == "application/vnd.ogc.wms_xml") clientResponse.ContentType = "text/xml";
 else clientResponse.ContentType = serverResponse.ContentType;&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (Stream byteStream = serverResponse.GetResponseStream()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:03:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449129#M41485</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-12-11T20:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Chrome, WMS and content-type application/vnd.ogc.wms_xml fails..</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449130#M41486</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt; I just encountered this problem as well, and fortunately found this thread that clarified what the cause was. Since I need to use a proxy for the GetCapabilities request, I've just edited the proxy so that a ContentType of 'application/vnd.ogc.wms_xml' with 'text/xml' before the response is returned.&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;If you're using the current DotNet version of the resource-proxy Esri has hosted on GitHub (&amp;nbsp; &lt;A href="https://github.com/Esri/resource-proxy" rel="nofollow noopener noreferrer" target="_blank"&gt;https://github.com/Esri/resource-proxy&lt;/A&gt;), you can make this change near the start of the fetchAndPassBackToClient method in the proxy.ashx file (around line 293):&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt; &lt;PRE class="lia-code-sample line-numbers language-none"&gt;private bool fetchAndPassBackToClient(System.Net.WebResponse serverResponse, HttpResponse clientResponse, bool ignoreAuthenticationErrors) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (serverResponse != null) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;STRONG style="color: &amp;quot;#FF0000&amp;quot;;"&gt;if (serverResponse.ContentType == "application/vnd.ogc.wms_xml") clientResponse.ContentType = "text/xml";
 else clientResponse.ContentType = serverResponse.ContentType;&lt;/STRONG&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; using (Stream byteStream = serverResponse.GetResponseStream()) {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ....&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Mike!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It helped me a lot!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 20:03:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/chrome-wms-and-content-type-application-vnd-ogc/m-p/449130#M41486</guid>
      <dc:creator>VivekPrasad</dc:creator>
      <dc:date>2021-12-11T20:03:25Z</dc:date>
    </item>
  </channel>
</rss>

