Problem with using GP Service from web client

3229
4
04-23-2010 08:40 AM
ChaseBarnard
New Contributor II
We have created a GP Service via a published tool layer in ArcGIS Server 9.3.1. The MXD and model are attached.  The output of the model is a polygon shapefile which is then exposed via resulting map service.  The model seems to run correctly with no errors and the service has been consumed successfully from the ArcGIS Desktop application.  The final output will be a mailing list generated from a FLEX Web App.

We have been unsuccessful in figuring out how to call the REST API from FLEX or the predefined HTML interfaces.  One point of confusion is the scratchworkspace.  This is defined in the application as the Scratch folder under the toolshare folder as directed, however it is not clear to me how this information is updated when the task is executed from the web client.  The shapefile in the jobs folder is updated but since the sublayer in the MXD references the scratch folder under the toolshare folder how is the output ever exposed?  The result is that there does not to appear to any link between the GP Service and the resulting map service.  I think we are just missing something obvious but at this point have hit a wall.  Any help is appreciated.

Chase Barnard
0 Kudos
4 Replies
RaviNarayanan
Esri Contributor
We have created a GP Service via a published tool layer in ArcGIS Server 9.3.1. The MXD and model are attached.  The output of the model is a polygon shapefile which is then exposed via resulting map service.  The model seems to run correctly with no errors and the service has been consumed successfully from the ArcGIS Desktop application.  The final output will be a mailing list generated from a FLEX Web App.

We have been unsuccessful in figuring out how to call the REST API from FLEX or the predefined HTML interfaces.  One point of confusion is the scratchworkspace.  This is defined in the application as the Scratch folder under the toolshare folder as directed, however it is not clear to me how this information is updated when the task is executed from the web client.  The shapefile in the jobs folder is updated but since the sublayer in the MXD references the scratch folder under the toolshare folder how is the output ever exposed?  The result is that there does not to appear to any link between the GP Service and the resulting map service.  I think we are just missing something obvious but at this point have hit a wall.  Any help is appreciated.

Chase Barnard


Chase,

This help topic here provides information about configuring the scratchworkspace for tools that are published in ArcGIS Server (see section Creating Models for Geoprocessing Service). Please check it out.
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_geoprocessing_with_ArcG...

Thanks
0 Kudos
JeanBallhorn
New Contributor
I have a similar question.  The online example for creating a Buffered Point service describes creating Scratch.gdb, which is never used in the example.  The instructions then go on to direct the output polygon to %scratchworkspace%\BufferedPoints.shp 
When testing this it seems that the output data (as shapefiles) will never be overwritten.  If the output is directed to Scratch.gdb, the model fails to run consecutively as a the output feature class already exists after the first execution of the model.

It would be helpful to understand the seeming inconsistency in the online documentation with regard to the scratch workspace.
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=GP_Service_step-by-step%3A_Buffer_poin...

If the service is used by an online client, how do you manage output data for calls from multiple instances of the web application?
0 Kudos
KevinHibma
Esri Regular Contributor
jballhorn,

You have a good point, it does seem a bit misleading. The topic could simply have the first couple steps of creating the scratch fGDB removed and everything will work as-is. (The fGDB is not used in the example, though it could have been)

As you note, the output is set to %scratchworkspace%\BufferedPoints.shp. This comes into line with setting the scratchworkspace in the environment settings a little further on in the topic. The scratch space is set to a folder. If the scartchworkspace was  set to the created fGDB at the start, you'd write the output almost the same, just remove the .shp from the BufferPoints name.

For your last question on how to avoid the collision between multiple web clients: This is best explained under the topic: http://webhelp.esri.com/arcgisdesktop/9.3/body.cfm?tocVisable=1&ID=1124&TopicName=Creating%20models%...  (Look for section : Concurrent use of data - %scratchworkspace%)

Hope this helps.

I have a similar question.  The online example for creating a Buffered Point service describes creating Scratch.gdb, which is never used in the example.  The instructions then go on to direct the output polygon to %scratchworkspace%\BufferedPoints.shp 
When testing this it seems that the output data (as shapefiles) will never be overwritten.  If the output is directed to Scratch.gdb, the model fails to run consecutively as a the output feature class already exists after the first execution of the model.

It would be helpful to understand the seeming inconsistency in the online documentation with regard to the scratch workspace.
http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=GP_Service_step-by-step%3A_Buffer_poin...

If the service is used by an online client, how do you manage output data for calls from multiple instances of the web application?
0 Kudos
ChaseBarnard
New Contributor II
Sending links to documentation isn't really helpful at this point.  I have read everything I can find in the resource center, hence this post.  After attending the SERUG conference last week, I now understand that scratchworkspce works differently in the authoring environment than in ArcGIS Server.   I also understand that I should not need a resutling map service for this application.  However, the service call is still not working.  Can anyone take a look at the code I included in the original post?

-Chase
0 Kudos