Incorporating Secured REST Services

1309
26
Jump to solution
05-10-2013 06:36 AM
KennethLyons
New Contributor
I'm having an issue with incorporating a REST Service that requires a username/password in order to view.  I've attempted to use the "Generate Token" option and that has worked for me in the past, however, I'm having no luck this time around. 

Is there something that I'm missing when inputting the code?  below is the URL with token that was generated from the site.

url="https://www.oagisargissvr.beta.state.pa.us/ArcGIS/rest/services/DMVA_SAFER_AVL/MapServer/1?token=UW1....">

I've tried several variations of this (http/https, with/without "1?" before "token")  even generated tokens for each variation.  I must be missing something because this wasn't that difficult in the past. 

thanks in advance for your assistance.
Tags (2)
0 Kudos
26 Replies
RobertScheitlin__GISP
MVP Emeritus
Ken,

   You have me seriously handicaped here as you have not given me any info on the layer you want to symbolize... What type of geometry is it are you wanting just a simple single symbol or a unique value renderer based on a field, etc, etc...
0 Kudos
KennethLyons
New Contributor
Rob,

Sorry for the confusion.  As I said, this is something that I've never had to do, so I'm not even sure where to start.

Here is the info off of the REST Services page.  I believe that this is the info that you're asking for.


I think what I'm looking for is a Unique Value Renderer.  The service that I'm attempting to display selects an icon based on 3 fields.
STATUS
TYPE
SECURE_YN

Here is what I've come up with based on what I've read on the link you sent.  Please let me know if I'm on the right track


<uniquevaluerenderer>
    <field name="STATUS">
    <field name="TYPE">
    <field name="SECURE_YN">
    <fielddelimiter=",">
</uniquevaluerenderer>
<uniquevalueinfo>
     <value="UNRESPONSIVE,HMV,N" label="assests/images/sleet.png">
</uniquevalueinfo>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

  Close...

<layer label="Fires" type="feature" visible="false" alpha="1"
                   url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0">
                   <uniquevaluerenderer field="type" fielddelimiter=",">
                        <uniquevalueinfo value="3" label="Campground">
                             <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/4A138C60" height="20" width="20"/>
                        </uniquevalueinfo>
                        <uniquevalueinfo value="2" label="Contained Fire">
                            <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/7D8E714C" height="20" width="20"/>
                        </uniquevalueinfo>
                    </uniquevaluerenderer>
            </layer>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   Also don't forget to mark this thread as answered.

Don't forget to click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos
KennethLyons
New Contributor
Rob, 

Based on what you've shown me.  Here is what I have come up with so far.   However, the icons are not changing when I run the program.  Is there something else I'm missing?  Does the URL have to be an actual web address?



<layer label="DMVA Inactive" type="feature" visible="false" alpha="1" 
                    url="https://www.oagisargissvr.beta.state.pa.us/ArcGIS/rest/services/DMVA_SAFER_AVL/MapServer/2?token=mq3pMZuiWDvMpOJeYoE5XbrWLwLpYVGB4dKeQxzfW7gVtL_YSLqs-YFM7pF8zPqffMWeBU83wjtHuFEm436NgA.."> 
                  <uniquevaluerenderer field="TYPE">                  
                       <uniquevalueinfo value="HMV" label="HMV">
                            <picturemarkersymbol height="20" width="20" url="assets/images/Sleet.png"/>                                  
                       </uniquevalueinfo>
                        
                       <uniquevalueinfo value="Transport" label="Transport">
                            <picturemarkersymbol height="20" width="20" url="assets/images/Ice.png"/>         
                       </uniquevalueinfo>
                   </uniquevaluerenderer>
                   
             <popupconfig="popups/BFT/800MHz.xml"/>
            </layer>

Thanks again.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   Nope using the viewers assets folder works fine:

            <layer label="Fires" type="feature" visible="false" alpha="1"
                   url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0">
                   <uniquevaluerenderer field="type" fielddelimiter=",">
                        <uniquevalueinfo value="3" label="Campground">
                             <picturemarkersymbol url="assets/images/es.png" />
                        </uniquevalueinfo>
                        <uniquevalueinfo value="2" label="Contained Fire">
                            <picturemarkersymbol url="assets/images/fr.png" />
                        </uniquevalueinfo>
                        <uniquevalueinfo value="4" label="Damaged Home">
                            <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/7D11DE72" />
                        </uniquevalueinfo>
                        <uniquevalueinfo value="0" label="Fire Department">
                            <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/86A29AC1" />
                        </uniquevalueinfo>
                        <uniquevalueinfo value="6" label="Mountain">
                            <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/41B1D33E" />
                        </uniquevalueinfo>
                        <uniquevalueinfo value="5" label="Ranger Station">
                            <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/EEA508E3" />
                        </uniquevalueinfo>
                        <uniquevalueinfo value="1" label="Shelter">
                            <picturemarkersymbol url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Fire/Sheep/FeatureServer/0/images/B0F5149C" />
                        </uniquevalueinfo>
                    </uniquevaluerenderer>
            </layer>
0 Kudos
KennethLyons
New Contributor
Rob,

I apologize for continuing this thread.  It seems like this issue should have been handled by now.  But the Unique Value Renderer lines of code aren't changing anything.  Is it possible that the issue is steming from another area? 

Here is what I have as far as the code goes,
<layer label="DMVA Inactive" type="feature" visible="false" alpha="1" 
                    url="https://www.oagisargissvr.beta.state.pa.us/ArcGIS/rest/services/DMVA_SAFER_AVL/MapServer/2?token=mq3pMZuiWDvMpOJeYoE5XbrWLwLpYVGB4dKeQxzfW7gVtL_YSLqs-YFM7pF8zPqffMWeBU83wjtHuFEm436NgA.."> 
                  <uniquevaluerenderer field="TYPE" fielddelimiter=",">                  
                       <uniquevalueinfo value="HMV" label="HMV">
                            <picturemarkersymbol height="20" width="20" url="assets/images/excel.png"/>                                  
                       </uniquevalueinfo>
                        
                       <uniquevalueinfo value="Transport" label="Transport">
                            <picturemarkersymbol height="20" width="20" url="assets/images/ru.png"/>         
                       </uniquevalueinfo>
                   </uniquevaluerenderer>
                   
             <popupconfig="popups/BFT/800MHz.xml"/>
            </layer>


Is this a function that is available as far back as Flex 2.5?  That's the only other thing that I can think of that might cause an issue.  If I can get one icon to change, I know I can make the rest work,  but so far Ive been unsuccessful.

Thanks again for your assistance.
0 Kudos
KennethLyons
New Contributor
Another thought.  Could part of the issue be that I cannot access any of the attributes associated with each point.  This would explain why the Unique Value Renderer isn't changing anything, because it can't access any values to assign.

If this is part of the problem.  how do I go about addressing this?

thanks
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

   That would definitely be the issue but the MAIN issue is that you are using FV 2.5 and it DOES NOT support the layer symbology tags. What do you mean you can not access any of the attributes for that layer? Are you sure you are using the right field names? Have you double checked them against the Rest Service directory?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Ken,

  Setting the symbology in the XML was not introduced until 3.1 in earlier version it has to be done in the code. Do you have access to Flash Builder where I can instruct you where to make the changes in the source code?
0 Kudos