<div>Hi! </div><div><br></div><div>I am working with OpenLayers 2.10 and I have a question regarding error trapping when using OpenLayers.Layer.WMS (or OpenLayers.Layer.WMS.Post). My goal is to provide some validation that a WMS layer has been configured properly and that the custom SLD being dynamically applied is also valid. I&#39;m open to suggestions as to how to accomplish this, however to date my efforts have involved setting the EXCEPTIONS parameter in the WMS params to return application/vnd.ogc.se_xml and then attempting to intercept the WMS response in order to check. In a success situation the WMS will return a .gif image. If there&#39;s an error the WMS will send the little snippet of XML.</div>

<div><br></div><div>I have included a functional WMS link below that has a deliberate error with the SLD reference given. I have also included the XML response. </div><div><br></div><div>My issue is that I cannot for the life of me figure out how to get my hands (programmatically speaking of course) on that XML error response when the tiles are loaded by the OpenLayers.Layer.WMS object. I would like to intercept the response to the call made by the OpenLayers.Layer.WMS class to the WMS server when loading the tiles. It appears as if the events provided that would be of possible use in my case are limited to &#39;loadend&#39;. With a little trickery I was able to get a &#39;tileloaded&#39; event listener to fire, however both listeners only promote the OpenLayers.Layer.WMS instance to the listener function and do not give access to the request/response made to/from the WMS server.</div>

<div><br></div><div>Any thoughts?</div><div><br></div><div>Thanks in advance for your help!</div><div>Paul</div><div><br></div><div><br></div><div>The pertinent params:</div><div>SLD=<a href="http://somethingbogus" target="_blank">http://somethingbogus</a></div>

<div>EXCEPTIONS=application/vnd.ogc.se_xml</div><div><br></div><div><br></div>
<div>The URL:</div><div><br></div><a href="http://mapsdb.nrel.gov/geoserver/wms?LAYERS=topp%3Astates&amp;TRANSPARENT=true&amp;FORMAT=image%2Fgif&amp;LAYER_TYPE=polygon&amp;SLD=http%3A%2F%2Fsomethingbogus&amp;EXCEPTIONS=application%2Fvnd.ogc.se_xml&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;SRS=EPSG%3A900913&amp;BBOX=-5009376.7456,5009377.424,-2504688.2032,7514065.9664&amp;WIDTH=256&amp;HEIGHT=256" target="_blank">http://mapsdb.nrel.gov/geoserver/wms?LAYERS=topp%3Astates&amp;TRANSPARENT=true&amp;FORMAT=image%2Fgif&amp;LAYER_TYPE=polygon&amp;SLD=http%3A%2F%2Fsomethingbogus&amp;EXCEPTIONS=application%2Fvnd.ogc.se_xml&amp;SERVICE=WMS&amp;VERSION=1.1.1&amp;REQUEST=GetMap&amp;STYLES=&amp;SRS=EPSG%3A900913&amp;BBOX=-5009376.7456,5009377.424,-2504688.2032,7514065.9664&amp;WIDTH=256&amp;HEIGHT=256</a><div>


<br></div><div><br></div><div>The response:</div><div><br></div><div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?&gt;&lt;!DOCTYPE ServiceExceptionReport SYSTEM &quot;<a href="http://mapsdb.nrel.gov:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd" target="_blank">http://mapsdb.nrel.gov:8080/geoserver/schemas/wms/1.1.1/WMS_exception_1_1_1.dtd</a>&quot;&gt; &lt;ServiceExceptionReport version=&quot;1.1.1&quot; &gt;   &lt;ServiceException&gt;</div>


<div>      java.net.UnknownHostException: somethingbogus</div><div>somethingbogus</div><div>&lt;/ServiceException&gt;&lt;/ServiceExceptionReport&gt;</div></div><div><br></div>