<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Secure Service get layer information with external application in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secure-service-get-layer-information-with-external/m-p/32796#M145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The token worked fine. I had two issue the token was being generated off a different machine than I was accessing and the url was being generated incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I corrected those issues everything was fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/DemoMapSecure/MapServer/layers?f=json&amp;amp;token=thFg7E-bxSV3rQLch0npGE5wl-kaJpGq1l4Rj0VDj12KAeG615HCneyx65QE2Flb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 16 Nov 2015 14:40:50 GMT</pubDate>
    <dc:creator>JimBridge</dc:creator>
    <dc:date>2015-11-16T14:40:50Z</dc:date>
    <item>
      <title>Secure Service get layer information with external application</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secure-service-get-layer-information-with-external/m-p/32795#M144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have .net app that retrieves avialable layers and fields to populate a report.&amp;nbsp; This application currently doesn't have any esri api's involved in it.&lt;/P&gt;&lt;P&gt;I have been getting this information using the following C# code in&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;SPAN&gt; mapserver r=&amp;nbsp; "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=https%3A%2F%2Fxxx.xxxxxxx.com%2Farcgis%2Frest%2Fservices%2FDemoMap%2FMapServer" rel="nofollow" target="_blank"&gt;https://xxx.xxxxxxx.com/arcgis/rest/services/DemoMap/MapServer&lt;/A&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; url = mapserver + (mapserver.Substring(mapserver.Length) == &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"/"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; ? &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;""&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; : &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"/"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;) + &lt;/SPAN&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"layers?f=json"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; request = &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;WebRequest&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;.Create(url);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #a31515; font-size: 10pt; font-family: Consolas;"&gt;"application/json; charset=utf-8"&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; text; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; response = (&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;HttpWebResponse&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;)request.GetResponse();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;using&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; (&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;var&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; sr = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 10pt; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-size: 10pt; font-family: Consolas;"&gt;StreamReader&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: Consolas;"&gt;(response.GetResponseStream()))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;{ text = sr.ReadToEnd(); }&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas;"&gt;JavaScriptSerializer&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt; jserialize = &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas;"&gt;new&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas;"&gt;JavaScriptSerializer&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas;"&gt;layers&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt; mylayers = jserialize.Deserialize&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="color: #2b91af; font-family: Consolas;"&gt;layers&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt;&amp;gt;(text);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000ff; font-family: Consolas;"&gt;return&lt;/SPAN&gt;&lt;SPAN style="font-family: Consolas;"&gt; mylayers;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;I now have a map they wish to secure. I'm not sure how I can still retrive the information.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;It intially says token missing I manually generated one and concatinated it on to the url. With that I'm getting the login page asking for userid and password.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: Consolas;"&gt;Any help would be apprececiated.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2015 19:44:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secure-service-get-layer-information-with-external/m-p/32795#M144</guid>
      <dc:creator>JimBridge</dc:creator>
      <dc:date>2015-11-13T19:44:30Z</dc:date>
    </item>
    <item>
      <title>Re: Secure Service get layer information with external application</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secure-service-get-layer-information-with-external/m-p/32796#M145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The token worked fine. I had two issue the token was being generated off a different machine than I was accessing and the url was being generated incorrectly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once I corrected those issues everything was fine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/DemoMapSecure/MapServer/layers?f=json&amp;amp;token=thFg7E-bxSV3rQLch0npGE5wl-kaJpGq1l4Rj0VDj12KAeG615HCneyx65QE2Flb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 16 Nov 2015 14:40:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/secure-service-get-layer-information-with-external/m-p/32796#M145</guid>
      <dc:creator>JimBridge</dc:creator>
      <dc:date>2015-11-16T14:40:50Z</dc:date>
    </item>
  </channel>
</rss>

