I copied the clip and ship application from the code gallery so I could teach myself how it works. I have the GP process working fine from ArcGIS Server and I can run the job from there. The problem is with the code below when I try to submiat a job to the GP service from a web page.
var features= [];
var layerBuildingsAtts = { "LayerName":"Buildings","DownLoad":"Yes" };
var layerBuildingsGraphic = new esri.Graphic();
layerBuildingsGraphic.setAttributes(layerBuildingsAtts);
features.push(layerBuildingsGraphic);
var layersToDownload = new esri.tasks.FeatureSet();
layersToDownload.features = features;
var params = { "Area_To_Download":clipFeatureSet,
"Email_address_to_send_zip_file":email,
"Layers_to_Download":layersToDownload};
console.debug(params);
gp.submitJob(params, completeCallback, statusCallback);
When I try to run it, I always get this message:
{"error":{"code":500,"message":"Error submitting task 'ExtractAndEmailPortlandData'. Please check your parameters.","details":["Invalid param value: {}","Unable to create the GP Value for parameter 'Layers_to_Download'"]}}
When I do the console debug in firebug, I can see the object loaded just fine. This code came straight from the Code Gallery so I am baffled that it doesn't work.
Can anyone please tell me what I am doing wrong?