<?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 Python Toolbox as Geoprocessing Service in Web App? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583290#M45728</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to publish a geoprocessing service generated from a python toolbox? This will be used in a web app, so is it possible that all the custom messages that were created in the python toolbox will appear in the web app when the geoprocessing service is used (the user will click a button to run the geoprocessing service)? Or do I have to write special code in javascript to create alerts that will be created from results of the geoprocessing service? The python toolbox works wonders in ArcMap so I am trying to figure out how to create a web app with a geoprocessing service resulting from that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 02 Oct 2013 16:14:24 GMT</pubDate>
    <dc:creator>ionarawilson1</dc:creator>
    <dc:date>2013-10-02T16:14:24Z</dc:date>
    <item>
      <title>Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583290#M45728</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is it possible to publish a geoprocessing service generated from a python toolbox? This will be used in a web app, so is it possible that all the custom messages that were created in the python toolbox will appear in the web app when the geoprocessing service is used (the user will click a button to run the geoprocessing service)? Or do I have to write special code in javascript to create alerts that will be created from results of the geoprocessing service? The python toolbox works wonders in ArcMap so I am trying to figure out how to create a web app with a geoprocessing service resulting from that.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:14:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583290#M45728</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-02T16:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583291#M45729</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I may not be telling something new, but you will need ArcGIS for Server for this, and setup a Geoprocessing Service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Two entry points most relevant in the Help are probably:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/#/What_is_a_geoprocessing_service/0154000004v5000000/"&gt;What is a geoprocessing service?&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//0154000004t1000000"&gt;An overview of geoprocessing REST Services&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 16:39:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583291#M45729</guid>
      <dc:creator>MarcoBoeringa</dc:creator>
      <dc:date>2013-10-02T16:39:11Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583292#M45730</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes, Marco. I have created geoprocessing services from toolboxes but never from a python toolbox and never using in a web app so I am not sure that would work. Would it?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 18:18:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583292#M45730</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-02T18:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583293#M45731</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;If you mean publishing your script as a geoprocessing service, yes it will work &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0154000005z2000000/"&gt;Here&lt;/A&gt;&lt;SPAN&gt; is a great step-by-step tutorial that covers the whole scope. It is about a printing geoprocessing service.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0154000005z2000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Tutorial_Advanced_high_quality_web_map_printing_exporting_using_arcpy_mapping/0154000005z2000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 18:58:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583293#M45731</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2013-10-02T18:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583294#M45732</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Matt, the example shows a python tool, but can I also publish the results of a python toolbox and would the messages created in it, pop up in a web app?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//001500000022000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//001500000022000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 19:03:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583294#M45732</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-02T19:03:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583295#M45733</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Python toolboxes can be published as a GP Service.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 19:56:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583295#M45733</guid>
      <dc:creator>KevinHibma</dc:creator>
      <dc:date>2013-10-02T19:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583296#M45734</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Kevin. Would the messages created appear if I run the gp service or in a web app?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Oct 2013 19:58:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583296#M45734</guid>
      <dc:creator>ionarawilson1</dc:creator>
      <dc:date>2013-10-02T19:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: Python Toolbox as Geoprocessing Service in Web App?</title>
      <link>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583297#M45735</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I usually script my stuff into a python.py file.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then I add my python script to a toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And finally I publish the gp result as a geoprocessing service as shown on the tutorial I recommended above.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After a quick look at python toolboxes, it seems to me that it is almost the same thing except that my two first steps are merged in one.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then to publish it a geoprocessing service, it works the same way.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can define inputs but you don't have to if you don't need any inputs from the webapp.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
input = arcpy.GetParameterAsText(0) #It should be working the same in a python toolbox or it should be something similar
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can define an output too if you want (that could be the "message" you are talking about) :&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
if the script works :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output = "job done"
else :
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output = "job not completed"

arcpy.SetParameterAsText(1, output)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- &amp;gt; in GetParameterAsText(0) and SetParameterAsText(1), 0 and 1 refer to the row number of the parameters list.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I don't know is how to define the inputs, output data-type (String, File), direction (Input, Output) and type (Optional, Derived) from a python toolbox (parameters don't appear in the toolbox properties). It might be filling out automatically with python toolbox.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then,&amp;nbsp; when you call your geoprocessing service from you webapp, it will return an output if you defined one.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:04:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-toolbox-as-geoprocessing-service-in-web-app/m-p/583297#M45735</guid>
      <dc:creator>SchoppMatthieu</dc:creator>
      <dc:date>2021-12-12T01:04:57Z</dc:date>
    </item>
  </channel>
</rss>

