laptop and a wrench

Bug

The WMS GetFeatureInfo operation in the text/plain format returns a http 400 error when no features are found.

ArcGIS GIS Server
Bug ID Number BUG-000175021
SubmittedMarch 13, 2025
Last ModifiedMay 22, 2025
Applies toArcGIS GIS Server
Version found11.3
Operating SystemWindows Server
Operating System Version2019 64 Bit
Version Fixed11.5, 3.5
StatusFixed

Additional Information

This issue is addressed in 11.5, 3.5

Workaround

The file “featureinfo_text_plain.xsl” under “...\ArcGIS\Server\framework\runtime\ArcGIS\Resources\Styles\WMS” was adapted to also receive a response in the case of features not found. The file was modified as follows:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:esri_wms="http://www.esri.com/wms" xmlns="http://www.esri.com/wms">

  <xsl:output method="text" indent="no" encoding="ISO-8859-1" omit-xml-declaration="yes"/>

  <xsl:variable name="newline">

    <xsl:text>

    </xsl:text>

  </xsl:variable>

  <xsl:template match="/">   

    <xsl:choose>

      <xsl:when test="esri_wms:FeatureInfoResponse/esri_wms:FeatureInfoCollection">

        <xsl:for-each select="esri_wms:FeatureInfoResponse/esri_wms:FeatureInfoCollection">@<xsl:value-of select="@layername"/><xsl:value-of select="$newline"/>

          <xsl:for-each select="esri_wms:FeatureInfo[1]/esri_wms:Field"><xsl:value-of select="esri_wms:FieldName"/>;</xsl:for-each><xsl:value-of select="$newline"/>

          <xsl:for-each select="esri_wms:FeatureInfo">

            <xsl:for-each select="esri_wms:Field"><xsl:value-of select="esri_wms:FieldValue"/>;</xsl:for-each><xsl:value-of select="$newline"/>

          </xsl:for-each>

        </xsl:for-each>

      </xsl:when>

      <xsl:otherwise>

        <xsl:text>The request is not allowed.</xsl:text>

      </xsl:otherwise>

    </xsl:choose>

  </xsl:template>

</xsl:stylesheet>

Steps to Reproduce

Bug ID: BUG-000175021

Software:

  • ArcGIS GIS Server

Get notified when the status of a bug changes

Download the Esri Support App

Discover more on this topic

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options