Problem with clip and ship GP service

1070
2
07-16-2010 07:39 AM
Jeffery_E_Dobb_Sr_
New Contributor
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?
0 Kudos
2 Replies
Jeffery_E_Dobb_Sr_
New Contributor
I made another discovery about this. It actually works if I take it back to version 1.1 of the JavaSCRIPT API like the Code Gallery example. Could someone tell me what that code would like like in the 1.6 or 2.0 versions? Thanks
0 Kudos
DonCaviness
New Contributor III
I was having the same problem and I found documentation that suggested making the request via a proxy page.  I set up a proxy page and made the request and a miracle happened, I didn't get anymore errors!  Here is the documentation I found http://help.arcgis.com/en/webapi/javascript/arcgis/help/jshelp_start.htm#jshelp/ags_proxy.htm.

I hope this helps.
0 Kudos