ArcGIS Feature Service Reader - how to auto renew token in workbench
Hello,
Using FME Workbench 2022.2 and am able to connect to ArcGIS Feature Service (10.9.1) via the reader with a supplied token (manually).
Is there a way in FME workbench to automatically regenerates the ArcGIS token everytime the workbench is run?
Thanks
Anthea
Page 1 / 1
Hello @antheatung, yes this should be possible in FME Form. To do this, I would use a Creator to initiate the workspace, the ArcGIS_S_Token custom transformer from the FME Hub to generate the token, and a FeatureReader to read the Feature Service Layer with the newly generated token:
The tokens created by the ArcGIS_S_Token hub transformer are referenced to the IP of the requesting machine and are limited to 180 minutes, or the maximum time defined in the Esri environment. If you need to change or edit the maximum timed defined, please refer to these instructions. Let me know if you have any questions about this! Happy to help, Kailin.
Hi @kailinatsafe thank you for pointing out to the custom ArcGIS_S_Token transformer - I am now able to get a token via Portal pointing to ArcGIS Server.
I am able to generate a token after running the transformer:
The next step is to use a FeatureReader transformer. I am using the ArcGIS Server Feature Service.
Question : How can I pass a token that was generated from the ArcGIS_S_Token tranformer to the FeatureReader’s ArcGIS Server Feature Service > Constraints in the Feature Types to read section?
Or do I need to generate another token to embed in here? Because I want to create a separate port to get a particular layer in the feature service.
The workbench does not retain the token I manually enter after run it once and the second time I run it, the Log will err with this:
ArcGIS Feature Service Reader: Could not access Feature Service at 'https://arcgisserverediting.gis.xyz..mywater.com:6443/arcgis/rest/services/EMPELE/EMPELE_NETWORK/FeatureServer'. This may be a temporary server issue, or insufficient permissions. The error code from the server was '498' and the message was: 'Invalid Token'
For initaially setting up the FeatureReader, you will need to copy paste the token from the custom transformer to the FeatureReader.
Once it is set up, you can use the output feature from the custom transformer as input for the FeatureReader and use the attribute with the token as input.
@nielsgerrits brilliant ! this did the trick ! Thank you !