I need to publish WMS service with GetFeatureInfo but I want to hide some fields. I've made them not visible using layer properties in ArcMap but it resolved the problem partially. When I add WMS service to our www geoportal I can't see hidden field in html popup. It's correct. But when I connect with WMS service through ArcCatalog and add the service to ArcMap, I can see still all the fields in Identify window.

Is it possible to hide the fields entirely by modifying the GetFeatureInfo XSL templates?


XSL transformation is the only way to handle your purpose. ArcGIS Server offers some templates to conduct this BUT when you use the ArcGIS Server xslt templates and modify them so that only some selected attributes will be shown, this template will be used for ALL services the server publish! You cannot configure that the template will be used only for a certain WMS. When you use and modify the template every GetFeatureInfo response will be transformed that way.

If your server publish more than one WMS and you want to transform just one specific service response you need to build up a servlet with a XSL transformator (e.g. on a tomcat) and a rewrite function (on an apache). The rewrite function modifies the GetFeatureInfo request URL and append your individual template at the URL and send this new request to the servlet to transform it. So the response will be an html that will pop-up in ArcMap or any other GIS or in a Web-Browser. Within an infrastructure of that kind it is possible transform any GetFeatureInfo response.

  • Thanks for your answer. I will try it in my free time. However, I resolved problem in a different way. I had created view from source table in Oracle, than I had registered it in SDE. Finally, Ihad published WMS service with registered view. It works. – Piotr Michalski Feb 24 '17 at 13:00

Yes it should be possible to remove or obscure the attribute values using the XSL templates, for example this is some pseudo code for the HTML template.

You need to have a test for the attribute(s) you want to want to not show, and supply the (in this case HTML) output you wish to substitute.

<xsl:for-each select="esri_wms:FeatureInfo">
    <xsl:for-each select="esri_wms:Field">
            <xsl:when test="some test for your attribute.">
                  <!-- Some output like below-->
                  <p>Attribute value withheld</p>
                  <xsl:value-of select="esri_wms:FieldValue"/>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.