Select to view content in your preferred language

Token and FlexViewer what's the trick?

2367
2
07-25-2012 02:52 PM
FrankRoberts
Occasional Contributor III
I have used secured a service in AGS manager, and then generated 300 day token via the token manager at the rest end point. I have tested that token in the JavaScript API (scandelouse aren't I...).  The token and maps seems to work in my basic JS map, so I'm pretty sure that is good.  I have placed this jsmap in the same folder as my flex index.html file, so they are running from the sample place, since the token is tied to that url, per the token generating screen.

I have then added my token to my config file as so:

<layer label="Public Water Systems" type="feature" visible="true"
  token="gVxKVHcjS_ywXHS7ymQJnEfmq04sfOvFF2ntSWUiWPKxW-eAxUJ-9osTofc6kP9ZmM8cugZ9QRadK-SqRs29_3g.."               
                url="http://myserver/ArcGIS/rest/services/MyProject/MyService/MapServer"/>

The I then dump the cache in the browser and load the Flexviewer.  No errors occur in the viewer, and the "More..." button in the viewer displays the name of my service by no data layers underneath it.

Via Fiddler I'm seeing an error:
POST /ArcGIS/rest/services/MyProject/MyService/MapServer/query?token=gVxKVHcjS%5FywXHS7ymQJnEfmq04sfOvFF2ntWUiWPKxW%2DeAxUJ%2D9osTofc6kP9ZmM8cugZ9QRadK%2DSqRs29%5F3g%2E%2E

[h=2]Error
[h=3]Specified format is not supported
Code: 400


Invalid URL


Other notes:
AGS 10.0 Sp 3
FlexViewer 2.5

Any idears or help would be Great!

Happy summer all!
Tags (2)
0 Kudos
2 Replies
DasaPaddock
Esri Regular Contributor
You need to change the type to "dynamic" or change the url to point to a feature layer.

e.g.,
http://myserver/ArcGIS/rest/services/MyProject/MyService/MapServer/0
0 Kudos
FrankRoberts
Occasional Contributor III
Thank you Dasa, that fixed it.  It is always those little things....
0 Kudos