<?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: GP Tool Optional Featureset Parameter in ArcGIS API for Silverlight Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226289#M5763</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Was this issue ever resolved. I have the same issue using AGS 10.0 with Silverlight.&amp;nbsp; I've tried everything I can think of and nothing works. I'm my case, I need to pass as many as 3 feature sets which may or may not have features in them. I don't want to have to create and maintain a separate script for each possibility but that's the only other solution I can see at this point.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Jun 2013 12:24:08 GMT</pubDate>
    <dc:creator>JohnUnderwood</dc:creator>
    <dc:date>2013-06-20T12:24:08Z</dc:date>
    <item>
      <title>GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226284#M5758</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a GP tool that has an &lt;/SPAN&gt;&lt;STRONG&gt;optional Featureset&lt;/STRONG&gt;&lt;SPAN&gt; parameter (rest definition is included at the end) which I don't seem to be able to cope with in the silverlight API.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using Fiddler I can see that the rest submit page creates the parameter with an empty value. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I exclude this parameter before calling the tool I get an "Error submiting job" message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If in c# I do:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FSet = new FeatureSet();
&amp;nbsp; //nothing added to FSet.Features
&amp;nbsp; Parameters.Add(new GPFeatureRecordSetLayer("BuildingPolygons_Input", FSet));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then fiddler shows the parameter with the following value:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{"features":[]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This causes the GP tool to return an "Unable to complete the operation" message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If I try&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FSet = null
&amp;nbsp; Parameters.Add(new GPFeatureRecordSetLayer("BuildingPolygons_Input", FSet));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;or&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Parameters.Add(new GPFeatureRecordSetLayer("BuildingPolygons_Input", ""));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The silverlight API throws the following exception before the call is made to the GP tool:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;"Object reference not set to an instance of an object."&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.GPRecordSet.ToJson(Boolean normalizeCentralMeridian)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.Geoprocessor.GetParameters(List`1 parameters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at ESRI.ArcGIS.Client.Tasks.Geoprocessor.SubmitJobAsync(List`1 parameters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at AECOM.ESP.ViewModels.Surface.AnalysisDetailLOSViewModel.Run()&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So how do I go about not providing the parameter or providing an empty parameter?&amp;nbsp; Failing this can anything be done in the GP tool?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance, Matt &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Parameter: BuildingPolygons_Input&lt;BR /&gt;&lt;BR /&gt;Data Type: GPFeatureRecordSetLayer&lt;BR /&gt;Display Name: BuildingPolygons_Input&lt;BR /&gt;Direction: esriGPParameterDirectionInput&lt;BR /&gt;Default Value: &lt;BR /&gt;&lt;BR /&gt;Geometry Type: esriGeometryPolygon&lt;BR /&gt;Spatial Reference: 2232&lt;BR /&gt;Fields: &lt;BR /&gt;FID (Type: esriFieldTypeOID, Alias: FID) &lt;BR /&gt;Shape (Type: esriFieldTypeGeometry, Alias: Shape) &lt;BR /&gt;BaseElev (Type: esriFieldTypeDouble, Alias: BaseElev) &lt;BR /&gt;Height (Type: esriFieldTypeDouble, Alias: Height) &lt;BR /&gt;TopMSL (Type: esriFieldTypeDouble, Alias: TopMSL) &lt;BR /&gt;Name (Type: esriFieldTypeString, Alias: Name) &lt;BR /&gt;Shape_Length (Type: esriFieldTypeDouble, Alias: Shape_Length) &lt;BR /&gt;Shape_Area (Type: esriFieldTypeDouble, Alias: Shape_Area) &lt;BR /&gt;Parameter Type: esriGPParameterTypeOptional&lt;BR /&gt;Category: &lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:01:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226284#M5758</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2021-12-11T11:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226285#M5759</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;FSet = new FeatureSet();
&amp;nbsp; //nothing added to FSet.Features
&amp;nbsp; Parameters.Add(new GPFeatureRecordSetLayer("BuildingPolygons_Input", FSet));&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This code looks good.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But it may happen that your tool doesn't support empty feature set and return the "Unable to complete the operation" message.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Are you able to run your tool directly from your browser (i.e without SL API)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 11:01:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226285#M5759</guid>
      <dc:creator>DominiqueBroux</dc:creator>
      <dc:date>2021-12-11T11:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226286#M5760</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;&lt;BR /&gt;But it may happen that your tool doesn't support empty feature set and return the "Unable to complete the operation" message.&lt;BR /&gt;&lt;BR /&gt;Are you able to run your tool directly from your browser (i.e without SL API)?&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes I can use the rest submit page and leave the parameter box empty - this works.&amp;nbsp; Fiddler shows the parameter has a completly empty value.&amp;nbsp; But when using the code you quote fiddler shows {"features":[]} and it fails.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks Matt.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 14 Sep 2012 13:31:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226286#M5760</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2012-09-14T13:31:38Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226287#M5761</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone verify this is an issue or give further suggestions please?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 10:00:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226287#M5761</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2012-09-17T10:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226288#M5762</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have now upgraded to v3 of the API.&amp;nbsp; The JSON output shown by fiddler has changed from:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{"features":[]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;to simply:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But I still get an error.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm going to raise a bug (if I can figure out how)!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Sep 2012 13:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226288#M5762</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2012-09-24T13:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226289#M5763</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Was this issue ever resolved. I have the same issue using AGS 10.0 with Silverlight.&amp;nbsp; I've tried everything I can think of and nothing works. I'm my case, I need to pass as many as 3 feature sets which may or may not have features in them. I don't want to have to create and maintain a separate script for each possibility but that's the only other solution I can see at this point.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Jun 2013 12:24:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226289#M5763</guid>
      <dc:creator>JohnUnderwood</dc:creator>
      <dc:date>2013-06-20T12:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: GP Tool Optional Featureset Parameter</title>
      <link>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226290#M5764</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I worked with esri support on this one.&amp;nbsp; Here is their last response:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I was able to reproduce the issue you reported today when publishing in ArcGIS Server 10.0.&amp;nbsp; I also noticed that it is possible to supply only one parameter (Button B in your sample) and get a successful result when working with a similar service published using ArcGIS Server 10.1.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;At this point the project was handed off to someone else so I can't confirm is 10.1 solves the issue.&amp;nbsp; I do have a test app which I can share if needed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2013 08:36:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-silverlight-questions/gp-tool-optional-featureset-parameter/m-p/226290#M5764</guid>
      <dc:creator>MatthewPilgrim</dc:creator>
      <dc:date>2013-06-21T08:36:45Z</dc:date>
    </item>
  </channel>
</rss>

