Select to view content in your preferred language

ExtractData in JS 4.x

639
5
06-23-2023 09:46 AM
LefterisKoumis
Regular Contributor II

ArcGIS Server version 10.9.1

This is about the ExtractData service of the SpatialAnalysisTools  in the system folder. 

In a standalone server, admin can allow the system folder in the ArcGIS server Manager to be accessible by everyone or select users. However, if the server is federated and then that option is not available. The only way to access the service is through tokens. That would make sense if the server is a public facing server. In my case. the server resides in an intranet environment behind a firewall. So, here is my first question. Why ESRI decides to make things complicated and not allow the option for the admin to set system folder open for everyone, if the server is not accessible by the pubic.

I tried to use this but it fails without tokens since the url is on a federated service. Has anyone succeeded running the ExtractData service on a federated server?

 

let url = "https://xxxxxx/rest/services/System/SpatialAnalysisTools/GPServer/ExtractData/submitJob"
  var options = {
    inputLayers:[{"url":layer.url, "filter":"1=1"}],
    dataFormat:"SHAPEFILE",
    outSR: 102100,
    outputName: {
      title: 'TEST'      
    }  
  }

esriRequest(
url, options).then ((response) =>{
  console.log(response)
})

 

 

0 Kudos
5 Replies
BlakeTerhune
MVP Regular Contributor

From the documentation:

Available only to users with an organizational subscription. Invokable only by the service item owner or an administrator.

I think because it creates an item. If you are only downloading, then you can do that without logging in.

0 Kudos
LefterisKoumis
Regular Contributor II

Thanks but I was referring to this, extract.

https://developers.arcgis.com/rest/analysis/api-reference/extract-data.htm

and I use JS.

0 Kudos
BlakeTerhune
MVP Regular Contributor

My bad. Thank you for clarifying.

0 Kudos
Justin_Greco
Occasional Contributor II

It might be better to post this under the ArcGIS Enterprise community, this doesn't really fall under the JavaScript SDK.  I think it all comes down to the user's user type and role, you need to at least have a User role since it creates an item on the Portal that can be downloaded.

LefterisKoumis
Regular Contributor II

I tend to disagree. This is similar to other REST service I use in my JS scripts. This is not an export item issue. 

In version JS 3.x there is a sample in JS.

I can't get it working in 4.x

https://developers.arcgis.com/javascript/3/jsapi/extractdata-amd.html

0 Kudos