<?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 1500 API - Problems deserializing XML Polygon representation in ArcGIS Explorer Desktop Questions</title>
    <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/1500-api-problems-deserializing-xml-polygon/m-p/34202#M194</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;experiencing some trouble with xml representations. I've taken Mike's Map Service Query example and modified it to accept a tracked polygon, via the SOAP API. Unfortunately this seems to work for the first identify function - but not the second.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The procedure is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ESRI.ArcGISExplorer.Geometry.Geometry geo = null;
if (!serviceIdentifyParams.IsPolygon)
{
&amp;nbsp;&amp;nbsp; geo = ESRI.ArcGISExplorer.Geometry.Point.CreateFromXmlString(serviceIdentifyParams.PointXMLRepresentation);
}else{&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; ESRI.ArcGISExplorer.Geometry.Polygon pp = ESRI.ArcGISExplorer.Geometry.Polygon.CreateFromXmlString(serviceIdentifyParams.PolyXMLRepresentation);
&amp;nbsp;&amp;nbsp; geo = (ESRI.ArcGISExplorer.Geometry.Geometry)pp;
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Fairly straightforward, and allows me to keep the code simple by using the Geometry class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Point identify operations, this works every time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Polygon identify operations, this works perfectly for the first click, returning a list of all features within the area. It always fails on the second run. I've placed markers in the code such that I know the failure is happening at Polygon.CreateFromXmlString... The cast operation was just to see if the failure was with creating the polygon, or placing the polygon inside geo.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The polygon is nothing special, and outputting the xml shows that from one request to the next the XML is not malformed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message which comes up isn't the standard "I screwed up my Add-in" one, with the option to send an email to support. This one looks like the attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any known bugs with this? It's a problem because the point idenfity doesn't return line features unless you're right on top, and I want to add some sort of configurable tolerance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Ben.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Sep 2010 12:12:59 GMT</pubDate>
    <dc:creator>BabbageOcelot</dc:creator>
    <dc:date>2010-09-02T12:12:59Z</dc:date>
    <item>
      <title>1500 API - Problems deserializing XML Polygon representation</title>
      <link>https://community.esri.com/t5/arcgis-explorer-desktop-questions/1500-api-problems-deserializing-xml-polygon/m-p/34202#M194</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi all,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;experiencing some trouble with xml representations. I've taken Mike's Map Service Query example and modified it to accept a tracked polygon, via the SOAP API. Unfortunately this seems to work for the first identify function - but not the second.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The procedure is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ESRI.ArcGISExplorer.Geometry.Geometry geo = null;
if (!serviceIdentifyParams.IsPolygon)
{
&amp;nbsp;&amp;nbsp; geo = ESRI.ArcGISExplorer.Geometry.Point.CreateFromXmlString(serviceIdentifyParams.PointXMLRepresentation);
}else{&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; ESRI.ArcGISExplorer.Geometry.Polygon pp = ESRI.ArcGISExplorer.Geometry.Polygon.CreateFromXmlString(serviceIdentifyParams.PolyXMLRepresentation);
&amp;nbsp;&amp;nbsp; geo = (ESRI.ArcGISExplorer.Geometry.Geometry)pp;
}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;Fairly straightforward, and allows me to keep the code simple by using the Geometry class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Point identify operations, this works every time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For Polygon identify operations, this works perfectly for the first click, returning a list of all features within the area. It always fails on the second run. I've placed markers in the code such that I know the failure is happening at Polygon.CreateFromXmlString... The cast operation was just to see if the failure was with creating the polygon, or placing the polygon inside geo.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The polygon is nothing special, and outputting the xml shows that from one request to the next the XML is not malformed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message which comes up isn't the standard "I screwed up my Add-in" one, with the option to send an email to support. This one looks like the attachment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any known bugs with this? It's a problem because the point idenfity doesn't return line features unless you're right on top, and I want to add some sort of configurable tolerance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Ben.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Sep 2010 12:12:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-explorer-desktop-questions/1500-api-problems-deserializing-xml-polygon/m-p/34202#M194</guid>
      <dc:creator>BabbageOcelot</dc:creator>
      <dc:date>2010-09-02T12:12:59Z</dc:date>
    </item>
  </channel>
</rss>

