<?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: How to return a FeatureClass or FeatureDataset from an SOE? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481170#M13028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It did throw an error when I tested it but it kept me with a few tweaks. I'm guessing that the silence from the rest of the community means that you and I are on the right track.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Feb 2015 20:50:58 GMT</pubDate>
    <dc:creator>JustinShepard</dc:creator>
    <dc:date>2015-02-02T20:50:58Z</dc:date>
    <item>
      <title>How to return a FeatureClass or FeatureDataset from an SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481168#M13026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using arcobjects to build an SOE and need to return a feature collection. The examples that I've found online focus on returning a single geometry result in json format. Since my result will potentially have hundreds of features and I'll need the attributes as well as the geometry I'm wondering if there is a standard way of returning a FeatureClass. Ultimately this SOE will likely be used in a .NET Runtime application so I want to make sure that the results are easy to import into an application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I will also have a couple of informational results to return, so I would like to set up the results something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informationalResult1={}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; informationalResult2={}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; featureClassResult={}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Right now I'm thinking that I'll have to create JsonObjects for each result category and have each exist within a larger results JsonObject. If that is the case is there a recommended way to convert an entire FeatureClass to a JsonObject?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 24 Dec 2014 14:54:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481168#M13026</guid>
      <dc:creator>JustinShepard</dc:creator>
      <dc:date>2014-12-24T14:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a FeatureClass or FeatureDataset from an SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481169#M13027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Justin. I think your approach using the Convert would probably be fine as long as the client knows what format to expect. You might consider converting the Feature Class to a Record Set and then converting it to JSON using SOESupport. I've put the example together from a couple of different sources though I haven't tried it. Good luck!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public static string FeatureClassToJSON(IFeatureClass pFeatureClass)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITable table = (ITable)pFeatureClass;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IRecordSetInit rsInit = new RecordSetClass();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IQueryFilter2 qf = new QueryFilterClass();&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rsInit.SetSourceTable(table, qf); // Load fc&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IRecordSet rs = rsInit as IRecordSet;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] jsonBytes = ESRI.ArcGIS.SOESupport.Conversion.ToJson(rs);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return Encoding.UTF8.GetString(jsonBytes, 0, jsonBytes.Length);&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ref: &lt;A href="http://bcdcspatial.blogspot.ca/2011/12/some-random-arcobjects-that-make.html" title="http://bcdcspatial.blogspot.ca/2011/12/some-random-arcobjects-that-make.html"&gt;bcdc spatial: Some random ArcObjects that make writing Server Object Extensions easier...(C#)&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Jan 2015 18:32:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481169#M13027</guid>
      <dc:creator>GregMcQuat</dc:creator>
      <dc:date>2015-01-05T18:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a FeatureClass or FeatureDataset from an SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481170#M13028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It did throw an error when I tested it but it kept me with a few tweaks. I'm guessing that the silence from the rest of the community means that you and I are on the right track.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 20:50:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481170#M13028</guid>
      <dc:creator>JustinShepard</dc:creator>
      <dc:date>2015-02-02T20:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to return a FeatureClass or FeatureDataset from an SOE?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481171#M13029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Fantastic! I'd appreciate seeing the working solution when you have it nailed down.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Feb 2015 21:13:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/how-to-return-a-featureclass-or-featuredataset/m-p/481171#M13029</guid>
      <dc:creator>GregMcQuat</dc:creator>
      <dc:date>2015-02-02T21:13:34Z</dc:date>
    </item>
  </channel>
</rss>

