<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"Lucida Console";
        panose-1:2 11 6 9 4 5 4 2 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='color:#1F497D'>Thanks David and Bart for your suggestions.
It is an interesting approach to tap the WMS capability of ArcGIS Server services
for use in OpenLayers. I was looking for a way to hit the ArcGIS Service
interface directly (for best performance). If I’m not mistaken,
once you secure an ArcGIS Server service then OGC capabilities (WMS< WCS,
and KML) are not accessible since ESRI’s security is not part of the OGC
spec. I wound up following Christopher Shmidt’s xyz-esri.html example
which covered my needs to work with tiled map services, and to pass in the
token value. Thanks Chris!<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'> function init(){<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
OpenLayers.Util.onImageLoadError = function() {
this.style.display="none";}<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
var layerExtent = new
OpenLayers.Bounds(-8037508.34,-8037508.34,8037508.34,8037508.34)<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
map = new OpenLayers.Map( 'map', {'Extent': layerExtent} );<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
layer = new OpenLayers.Layer.XYZ( "ESRI",<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
"http://mygisserver/ArcGIS/rest/services/mygisservice/MapServer/tile/${z}/${y}/${x}<span
style='background:yellow;mso-highlight:yellow'>?token=0000mytoken0000..</span>",<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
{sphericalMercator: true} );<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'>
map.addLayer(layer);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'> map.zoomToExtent(map.Extent);<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:8.0pt;font-family:"Lucida Console";
color:#31849B'> }<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>-Dave Wright<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>
users-bounces@openlayers.org [mailto:users-bounces@openlayers.org] <b>On Behalf
Of </b>David Wright<br>
<b>Sent:</b> Thursday, October 08, 2009 12:17 PM<br>
<b>To:</b> users@openlayers.org<br>
<b>Subject:</b> [OpenLayers-Users] Tokens for secure ArcGIS Server layers<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Hello users,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Has anyone found a way to pass the token value associated
with secured ESRI ArcGIS Server Dynamic<b> </b>Map service layer in OpenLayers
2.8?<o:p></o:p></p>
<p class=MsoNormal>Its always passed in as a parameter
“&token=mytokenvalue…”<o:p></o:p></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
var agsDaynamicLayer = new OpenLayers.Layer.AgsDynamic(<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
"i3 Nightlights (Dynamic)",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
"http://myArcGISServer/ArcGIS/rest/services/myDynamicService/MapServer/Export?",<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
LAYERS: 'show:0',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
IMAGESR: '900913',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
BBOXSR: '4326',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
FORMAT: 'png',<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
TRANSPARENT: true,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
},<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
{<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
isBaseLayer: false,<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
singleTile: true<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
}<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'>
);<o:p></o:p></span></p>
<p class=MsoNormal><span style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal>Many thanks,<o:p></o:p></p>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>-Dave<span style='font-size:8.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>