Hoppa till huvudinnehållet

GetMapServiceInfo doesn't return the correct map service URL due to missing connecting string in site.xml

Kommentarer

12 kommentarer

  • Permanently deleted user
    GetMapServiceInfo stopped giving me the Map Service Url after upgrading to 2.7 from 2.5. It started to give me the Geocortex Url instead. So for now I have the map service URL as one of the arguments. It does not do this for all map services. The one that works and the one that does not work are both dynamic map services.
    0
  • Permanently deleted user
    Hi Masao, sorry to hear you had the same issue but it means I'm not the only one. Yes I could set the URLs in the arguments, but I'm a bit hesitate to hard code or set argument in workflow with AGS username and password as the token genereated from GetMapServiceInfo is also Geocortex token not AGS token when the connection string missing.
    0
  • Kathy Andersen
    Jack, we are also just experiencing this issue after upgrading from GE 4.2 to 4.5.1 (HTML viewer 2.4 to 2.6.1).  Workflows built prior to the upgrade that use this activity work properly, but any new workflows (or workflows modified and saved with new Workflow Designer) return Geocortex Url instead of ArcGIS Url.
    0
  • Ryan Cooney
    This is the expected behaviour when you configure permissions on layers in your site.

     

    ArcGIS Server does not implement per-layer security so we handle this via the Essentials REST API. Essentials acts as a proxy for the ArcGIS Server service and applies the permission filtering logic to requests. The viewer actually thinks that the Essentials REST API is ArcGIS Server in this case.

     

    The empty connection string is intentional because we don’t actually want/need to tell the viewer where ArcGIS Server is. If you are really securing your layers ArcGIS Server should be behind a firewall and inaccessible to the viewer so there would be no point in telling the viewer what the URL to ArcGIS Server is anyway. There is logic in the viewer to detect the empty connection string and infer that it should use the Essentials URL instead.

     

    The GetMapServiceInfo activity returns the Essentials URL for the map service and the Essentials token when layer security is applied. This should be exactly what you need for the Query Task activity or other logic where you need to issue a request to ArcGIS Server that honours the configured permissions.

     

    --Ryan
    0
  • Permanently deleted user
    Ryan, Thanks for your answer. Eventually I have to come back to the same issue. OK I got what you mean here. The GetMapServiceInfo activty returned me a Essential URL of the map service like https://xxx.com/Geocortex/Essentials/REST/sites/MySite/map/mapservices/61/rest/services/x/MapServer, and a Essential token. Do you mean I then should be able to insert the URL + the native layer ID of the layer I want to query, and the Essential token into QueryTask activty? I've tried that but unformatnly it returns still returns me the same error. Am I missing something?..

     

     
    0
  • Ryan Cooney
    Hi Jack,

     

    Yes, that is the idea. The outputs of the Get Map Service Info activity are designed to provide everything you need to populate the Query Task activity.

     

    Some things to try:
    • Log the value you are supplying to the Query Task as the Query Service Url to ensure it is correct.
    • Manually assemble a request to the Essentials in a web browser to see if you can get it to work
      • ..Geocortex/Essentials/REST/sites/MySite/map/mapservices/61/rest/services/x/MapServer/<layerId>?f=json&where=1%3D1&token=<token>
    • Use a tool like Fiddler (on the server) to examine the outgoing request that the Query Task activity makes.
    This is a very common pattern that we use extensively. The pattern works for anonymous services, ArcGIS token sercured services, and Essentials Layer Security Proxy secured services.

     

    --Ryan
    0
  • Permanently deleted user
    Hi Ryan,

     

    thanks a lot to explain it again. Finally with your suggestion I have figured it out. Below is an example how I did it for anyone else having the same question.

     

    question related. Is there an built-in function in workflow to detect whether a map service support dynamicLayers?? the only way I could think of now is get get it from the JSON reponse of map service REST end point.

     

    Cheers,

     

    --Jack

     

    _img_ alt="User-added image" src="https://latitudegeo--c.na53.content.force.com/servlet/rtaImage?eid=907f2000000fyCT&feoid=Body&refid=0EMf2000000kAHT" _/_img_

     

     
    0
  • Permanently deleted user
    Hi Ryan and otheres

     

    Could you please clarify what happens to non-Geocortex secured map services? I have only ArcServer token secured services set up and  Map Service Info returns an ArcServer REST URL. However this causes problems in Display Forms where Task URL is set by default to the Geocortex REST URL. I would really like to use the Autocomplete Box UI to fill in values and not the RuntimeModifications as I have tons of Autocomplete Boxes. Is there a way to synchronise the two?

     

    Thank you,

     

    Helen
    0
  • Permanently deleted user
    Helen, have you tried Ryan's suggestion to manually assemble the reqeust URL using the Geocortex REST URL of the map service with the layer and token like below, and try it in web broswer? 

     

    ...Geocortex/Essentials/REST/sites/MySite/map/mapservices/61/rest/services/x/MapServer/<layerId>?f=json&where=1%3D1&token=<token>
    0
  • Permanently deleted user
    Hi Jack,

     

    I am currently struggling with exactly the same issue. I have tried your suggestion but it doesn't work in my case. I am wondering wha are the 'cast' and 'assign' activites in your example is for. The reason I am asking is because we've already got the mapserviceURL and layerID from the 'GetMapServiceInfo' activity. In the end, my composed Query Service URL is the same as my layerURL. Can we just bypass those 'cast' and 'assign' activites and use layerURL for the 'Query Service URL' in the Query Task instead?

     

     
    0
  • Permanently deleted user
    Hi Hery, 

     

    my example is for secured map service has dynamic layer enabled. If your map service doesn't have dynamic layer enabled, then yes you should bypass cas and assgin and just use the LayerURI output from GetMapServiceInfo.

     

    My understanding is, if the map service has dyanmic layers enabled, GetMapServiceInfo then couldn't get the original layer ID in the LayerID output nor the layerURL. therefore, I have to get it form the LayerSource output. and to do that, I have to cast the LayerSource object to LayerMapSource object, then from that, i can get the orignal layer ID by theLayerMapSource.MapLayerId.ToString

     

    Hope that helps

     

    regards,

     

    Jack
    0
  • Permanently deleted user
    Hi Jack,

     

    I am not sure why I get different result, but my map service is secured and dyamic layer is enabled. If I add 'Alert' activity below the 'GetMapServiceInfo', I will get the correct mapServiceURL or layerURL, which is the Geocortex site Rest URL. However, my QueryTask still doesn't work, even though I have tried a simple Where "1=1". So I assume there's something wrong with my layerURL.

     

    Using your 'Cast' and 'Assign' as in your example, I get the "Object reference not set to an instance of an object" error message in my 'Assign' activity. Anyway, I will keep working on it to figure it out.
    0

Du måste logga in om du vill lämna en kommentar.