Zum Hauptinhalt gehen

Check if a service is protected in a workflow(standard)

Kommentare

5 Kommentare

  • Zack Robison
    You could try cobbling something together using the Web Request activity, but I would recommend that you simply check the endpoint while writing the workflow to determine whether to use a token.  I don't know why you'd need to determine this dynamically, surely your services don't shange their security particularly often.
    0
  • Permanently deleted user
    Thanks for the answer. 

     

    Well, in short, we don't manage the services, the clients do, so I was trying to find a way of preventing( when they unsecure/secure a service) the workflow from crashing.

     

    Can you clarify what you mean by "checking the endpoint"? Through the Web request? Can you give an example?

     

    Thanks again. 
    0
  • Berend Veldkamp
    What I found to be the best way is to always use the Get Map Service Info activity, and use its Token output, even if the mapservice is not protected. The variable will be empty for non-protected mapservice and will be ignored by e.g. the Query Task activity.

     

    You can't use this approach if the mapservice you are using is not added to the site. In that case you will have to use a WebRequest activity with a GET request to the mapservices endpoint, e.g. https://server/arcgis/rest/service/MyService/MapServer?f=json. The response will be something like this: {"error":{"code":499,"message":"Token Required","details":[]}}

     

     
    0
  • Permanently deleted user
    Thanks for the answer.

     

    That's the case. sometimes the service is not added to the map hence why I didn't go with the Get Map service approach.

     

    For the Webrequest it's essentially the same as the Try Catch business wise. It has to throw an error before I know if it's protected or not.

     

    Thanks
    0
  • Berend Veldkamp
    In you look at it that way, everything is essentially the same as the TryCatch thing. The only way to know the status of any web service (that's not used in the site.xml) is to do an extra request to that service.

     

    The only difference in my example is that no exception is thrown, so you don't need a try catch. This makes the workflow a bit easier to read.

     

     
    0

Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.