Problems with Data Extraction GP Task

749
6
09-08-2010 12:05 PM
DonCaviness
New Contributor III
I have created a data extraction gp task and I have run into a problem that I can't seem to figure out.  In the gp service I have a list of choices that can be clipped, not all of the data is in the same coordinate system.  I have my JS code set so that I can pass the proper params to the service.  I am passing the "Layers_to_Clip", "Area_of_Interest", and "format" to the service, the service processes the information and I can get the zip file that is output.  The problem is that the created shapefile does not have any data associated with it.  At first I thought my service was the problem but I was able to extract any of the data using the Flex API.  Here is my JS code that I am using.  Does anyone know that the my issue could be?

var gpFeatureSet = new esri.tasks.FeatureSet();
var features= [];
    var xmax, ymax, xmin, ymin;
var mapExtentPoly;
var clipLayers = [];

        esri.config.defaults.io.proxyUrl = "proxy.ashx";
        esri.config.defaults.io.alwaysUseProxy = false;
 
var gp = new esri.tasks.Geoprocessor("http://server/ArcGIS/rest/services/DetailDataDownload_GP/GPServer/Extract%20Data%20Task");

    xmax = mapAll.extent.xmax;
    xmin = mapAll.extent.xmin;
    ymax = mapAll.extent.ymax;
    ymin = mapAll.extent.ymin;
   
    mapExtentPoly = new esri.geometry.Polygon(mapAll.spatialReference);
    mapExtentPoly.addRing([[xmin, ymax], [xmax, ymax], [xmax, ymin], [xmin, ymin], [xmin, ymax]]);
     
    var mapSymbol = new esri.symbol.SimpleFillSymbol();
    var mapGraphic = new esri.Graphic(mapExtentPoly, mapSymbol, "", "");
    mapAll.graphics.add(mapGraphic);
   
          features.push(mapGraphic);
    gpFeatureSet.features = features;
   
     layersToClip = clipLayers;
    
  var params = {
    "Area_of_Interest":gpFeatureSet,
    "Feature_Format":format,
    "Layers_to_Clip":layersToClip
    };
  
        gp.submitJob(params, completeCallback, statusCallback);
0 Kudos
6 Replies
DonCaviness
New Contributor III
Does anyone have an idea why I am having this issue?
0 Kudos
DonCaviness
New Contributor III
My service works perfectly in ArcMap, it just fails when I use it via the web.
0 Kudos
BenSayers
New Contributor II
Did you ever solve this problem? I'm trying to do the same as you but I keep getting the error:
""esri.config.defaults.io.proxyUrl is not set"
Do you have any pointers?
0 Kudos
DonCaviness
New Contributor III
I was able to solve my problem.  The problem that i was having was related to a bug in the JavaScript API.  I never did have an issue with using the proxyURL.  For that all I did was download the proxy.ashx and proxy.config file from the Esri documentation and referenced it as the documentation stated.
0 Kudos
BenSayers
New Contributor II
OK, thanks for your quick reply. I shall endeavour to get to the bottom of this. Thank you.
0 Kudos
RyanKelley
New Contributor II
Ben,

I had the same error ass you the other day... I had our SA set up an internet proxy on the server we are running our web app.  A lot of the sample code from the .js API ESRI pages have a generic URL that points to a non-existent proxy.

If you don't have the sample code, just put this your init function:

esri.config.defaults.io.proxyUrl = "http://..../proxy.ashx" Make sure your server has permissions to read this too.

ryan
portland, or
0 Kudos