Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have an asynchronous gp service that I can successfully run and cancel from within Arcmap.

Using fiddler I see that arcmap communicates with the GP service via SOAP.

I'd like to cancel the job using a REST request. However I don't see anything in the documentation for the GP Job describing how to do this.

Does anyone know if there's a RESTful way to cancel a job?

If not, would there be any bad side effects from writing another web service that scans the log file(s) to find the PID of the gp job then kills the process? (The gp service is configured non-pooled).

Update ESRI support confirmed no RESTful cancel method (incident #879881). They suggested using the SOAP cancelJob method instead.

share|improve this question
    
Enhance request has been submitted: #NIM063523 Provide a RESTful method to cancel GP jobs. –  Kirk Kuykendall Dec 13 '10 at 16:27
1  
At 10.1 you can now cancel GP jobs through REST: resources.arcgis.com/en/help/rest/apiref/gpCancel.html –  KHibma Oct 30 '12 at 20:25
add comment

2 Answers

I'd be careful writing a sort of scanner/kill application thats available as a service (security concerns). You could however keep it locally and just run it every X number of minutes using Task Scheduler. A Python script to read the log files, pull out the PID and then do a TASKKILL on the particular process would work. However if you do that I'd suspect it would put your GP Service into a bad state and then you'd want to recycle that service.

How about just dropping down the "max time a client can use a service"? That may/may not do what you need depending on how "bad" a state your GP service is getting stuck into.

share|improve this answer
    
Thanks for responding Kevin. I'm going to look into using SOAP for this. If that doesn't work, I might look into a max time limit. I suppose a timeout status is returned when that occurs(?) –  Kirk Kuykendall Dec 10 '10 at 13:57
    
I suggest having your GP jobs register themselves somehow (text file / DB table / etc) so that your kill script can only kill processes that have been registered. Then you reduce the risk of someone finding it and exploiting it to shut other things down on your server. –  mwalker Dec 10 '10 at 17:00
add comment

Though I realize the practical need, I don't think a "cancel job" request is ever a RESTful thing to do, i.e. cancelling a previous action implies state, but REST by definition is stateless.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.