I have a pretty simple geoprocessing script. My javascript is supposed to be passing it a list of layers to query. Something like this for the Javascript:

var params = { "Layers": "foo,bar,hello,world"};
var gp = new Geoprocessor(*myURL*);
gp.submitJob(params, gpSuccess, gpStatus, gpFailed);

The Geoprocessor just explodes the list based on the comma, and reads the layers from the database. Pretty straight forward. I'm reading the inputs in as a text string, like so:

layers = GetParameterAsText(0)

My code works fine in my own testing, the problem is when I have this running as a service, I can't seem to pass it the correct values. It always runs based off the default values (which end up being whatever I supplied when I did my test run in Arc Catalog). I have "layers" defined as an input variable for the model, so I'm not sure why it's not getting my input. Checking the job status verifies that it is running off the default values, and not what I am attempting to supply as an argument.

The geoprocessing script can be accessed through the REST interface here.

The source code can be found here.

  • Are you able to post the entire geoprocessing script, and/or provide a link to the online service (myURL above)? – Stephen Lead Feb 23 '16 at 22:06
  • Sure, I'll do that ASAP but I'm afraid neither are particularly clean. Should be up tomorrow morning. – two bugs Feb 24 '16 at 0:40
  • 2
    Added links to the public online service and the source code for the script. Both are probably sloppy. I regret nothing. – two bugs Feb 24 '16 at 13:06

I created a new Geoprocessing service from the same script, available here (Yes, I'm extremely good at naming services). I didn't do anything different (I used all the same configuration settings) but it appears to be working correctly now. My guess is there was an issue with the settings, but I honestly have no clue what it could be.

I'm not going to accept this as an answer because while it worked it certainly doesn't explain how or why this problem occurred, but it might help others in a similar situation. Hopefully someone more knowledgeable can shed some light on this eventually.

  • 1
    error message haiku: yesterday it worked / today it isn't working / software is like that – Stephen Lead Feb 24 '16 at 21:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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