<?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: Using GP Service with JS API in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599075#M56022</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Entering the URL in the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;localhost&amp;gt;/ArcGIS/rest/services/&amp;lt;servicename&amp;gt;/GPServer/&amp;lt;GP-Service&amp;gt;/submitJob"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; like in the attached 18.png works perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where is the difference to this code? should it not be the same?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.require("esri.tasks.gp");

&amp;nbsp; var param = {inputLayer: "C:\arcgisserver\scotturb\scotturb_lines_ida_half_test.shp"}
&amp;nbsp; var gp = new esri.tasks.Geoprocessor("http://wk2658/ArcGIS/rest/services/GP/GP/GPServer/server_schematic_model");
 
&amp;nbsp;&amp;nbsp; function generateDiagram() {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; gp.submitJob(param); 
&amp;nbsp;&amp;nbsp; } &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And i also tried "GPString" and "url" instead of "inputLayer"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:43:29 GMT</pubDate>
    <dc:creator>Stefan_Arndt</dc:creator>
    <dc:date>2021-12-12T01:43:29Z</dc:date>
    <item>
      <title>Using GP Service with JS API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599072#M56019</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'm trying to use the JavaScript API to process a Geoprocessing Service. This Service works fine with the ArcGIS Server WebApplication. Now i want to use it with JS. The GP Service needs a Shapefile as Input Parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So i read the Webhelp, the JS API Concepts and had a look at the Esri Samples. Then i tried to implement it. First like the samples, then in a more easy way with less code (just the basics).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But in no Case the Service is used.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm not very experienced with JavaScript, so probably there is a mistake in my Code. Perhaps in the Structure or with the Parameters. I attached the simple basic-Code with just one button to this Thread. Can anybody please have a lokk at it and check if everything is ok?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Because i'm not 100% sure if the service needs a Shapefile or a String to the Shapefile, i tried several opportunities.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;SPAN&gt;var inputLayer = "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://wk2658/ArcGIS/rest/services/scotturb/FeatureServer/0" rel="nofollow" target="_blank"&gt;http://wk2658/ArcGIS/rest/services/scotturb/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;"; &lt;/SPAN&gt;&lt;BR /&gt;var inputLayer = "C:\arcgisserver\scotturb\scotturb_lines_ida_half_test.shp";&lt;BR /&gt;&lt;SPAN&gt;var inputLayer = new esri.layers.FeatureLayer("&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://wk2658/ArcGIS/rest/services/scotturb/FeatureServer/0" rel="nofollow" target="_blank"&gt;http://wk2658/ArcGIS/rest/services/scotturb/FeatureServer/0&lt;/A&gt;&lt;SPAN&gt;");&lt;/SPAN&gt;&lt;BR /&gt;var inputLayer = new esri.layers.FeatureLayer("C:\arcgisserver\scotturb\scotturb_lines_ida_half_test.shp");&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ArcGIS Server 10 SP2 .NET Framework&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Read/Write Permissions are correct i think.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 May 2011 13:54:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599072#M56019</guid>
      <dc:creator>Stefan_Arndt</dc:creator>
      <dc:date>2011-05-17T13:54:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using GP Service with JS API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599073#M56020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;According to the api reference for geoprocessing at &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/geoprocessor.htm" rel="nofollow noopener noreferrer" target="_blank"&gt;http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/geoprocessor.htm&lt;/A&gt;&lt;SPAN&gt;, gp.submitJob() takes a json object for the input Parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Try something like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
var param = {inputLayer: "C:\arcgisserver\scotturb\scotturb_lines_ida_half_test.shp"}
var gp = new esri.tasks.Geoprocessor("http://wk2658/ArcGIS/rest/services/GP/GP/GPServer/server_schematic_model");
gp.submitJob(param);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Check your gp's input parameters and use those names when setting your parameter object.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599073#M56020</guid>
      <dc:creator>KenDoman</dc:creator>
      <dc:date>2021-12-12T01:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using GP Service with JS API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599074#M56021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey kdoman,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you for your answer. I think you're right! So i read the Geoprocessing Class Documentation again and edited my code, as you suggested.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And i found out that "dojo.require("esri.tasks.gp");" was also missing.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But it's still not working. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The integrated alert function (just to see if it works) occurs, so the function is called &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I attached the new code and 3 Pictures.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;15.png shows the screen, when i start running the Model in ArcMap and insert the Path to the Databse -&amp;gt; It works.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;16.png shows the Properties of the Model, which shows that a FeatureLayer is required as an input Parameter.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;17.png shows the ArcGIS Services Directory (REST) with the supported operation "SubmitJob". Additionally there is a Choice List as Input (the Layers of the Map Document), but when i choose another one in ArcMap Desktop this still works. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Someone any other ideas?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 May 2011 10:52:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599074#M56021</guid>
      <dc:creator>Stefan_Arndt</dc:creator>
      <dc:date>2011-05-18T10:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using GP Service with JS API</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599075#M56022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Entering the URL in the &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://" rel="nofollow noopener noreferrer" target="_blank"&gt;http://&lt;/A&gt;&lt;SPAN&gt;&amp;lt;localhost&amp;gt;/ArcGIS/rest/services/&amp;lt;servicename&amp;gt;/GPServer/&amp;lt;GP-Service&amp;gt;/submitJob"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; like in the attached 18.png works perfectly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where is the difference to this code? should it not be the same?&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
dojo.require("esri.tasks.gp");

&amp;nbsp; var param = {inputLayer: "C:\arcgisserver\scotturb\scotturb_lines_ida_half_test.shp"}
&amp;nbsp; var gp = new esri.tasks.Geoprocessor("http://wk2658/ArcGIS/rest/services/GP/GP/GPServer/server_schematic_model");
 
&amp;nbsp;&amp;nbsp; function generateDiagram() {&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp; gp.submitJob(param); 
&amp;nbsp;&amp;nbsp; } &lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And i also tried "GPString" and "url" instead of "inputLayer"&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:43:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/using-gp-service-with-js-api/m-p/599075#M56022</guid>
      <dc:creator>Stefan_Arndt</dc:creator>
      <dc:date>2021-12-12T01:43:29Z</dc:date>
    </item>
  </channel>
</rss>

