token based security and 10.1 printing gp service

8490
25
09-21-2012 07:13 AM
Drew
by
Occasional Contributor III
Has anyone successfully produced a print when using a secured service?

I am getting the following error..

Error executing tool.: Layer "ArcGISDynamicMapServiceLayer405": Unable to connect to map server at    [...Web map URL with token written here......] Failed to execute (ExportWebMap). Failed to execute (Export Web Map)




Is there something I need to configure?

Drew
Tags (2)
25 Replies
DrewDowling
Occasional Contributor III
AM
savaadaisu

Thanks for you input. I eventually went with using a proxy page instead of using a token directly and this solved my problems. Hope this helps others.
0 Kudos
MiriEshel
New Contributor III
Hi Drew,

What do you mean by : "using a proxy page instead of using a token directly "?
I use a proxy too in order to avoid typing the user & password but I cannot  print any map with secured layers.
Have you succeeded?

Thanks,
Miri
0 Kudos
DrewDowling
Occasional Contributor III
Hi Drew,

What do you mean by : "using a proxy page instead of using a token directly "?
I use a proxy too in order to avoid typing the user & password but I cannot  print any map with secured layers.
Have you succeeded?

Thanks,
Miri


I set up a proxy page using the esri proxy page code sample found on github. I then added both the print service and the secured map service to my flex app making sure to point the .Proxy property of each service to the proxy page I had just set up. This enabled me to remove the .Token property from the map service. When I did this the print task worked.

FYI more info on the bug here
0 Kudos
XiaowenHuang
New Contributor

I have the exact same issue with print task in javascript API. Could you let me know how do you setup proxy for print service? Thanks!

0 Kudos
DrewDowling
Occasional Contributor III

Here is the esri source code

Esri/resource-proxy · GitHub

download your preferred language and then install as a web app on oyur web server.

Next play around with the proxy.config settings until they are right for your environment. e.g.

<ProxyConfig allowedReferers="*"

             mustMatch="false">

    <serverUrls>

        <!--<serverUrl url="http://services.arcgisonline.com"

                   matchAll="true"/>-->

   

      <serverUrl url="http://MyWebServer:6080/arcgis/rest/services"

        username="MyID"

        password="MyPass"

        rateLimit="600"

        rateLimitPeriod="60"

        matchAll="true">

      </serverUrl>

    </serverUrls>

</ProxyConfig>

You might need to/probably should lock down what is available through the proxy. There are instructions on how to do this in the readme.txt

0 Kudos
LanceGosby
New Contributor

The bug that Drew mentioned applies to me. We are on 10.1. Here is what I've got and how I got around it.

I have a map service and a custom print service within a secured folder. I am able to print the map if I print the entire dynamic map service. I can even set the visibleLayers property to hide some layers. As soon as I try to print an individual feature layer from this map, it doesn't work. I have tried the exact same thing on an unsecured map service and it works as expected.

I wanted to print an individual feature layer so I could set the selectionObjectIds property in my webmap JSON to highlight a particular feature. As a work around, I added a graphics layer to the webmap JSON. I grabbed the selected feature's geometry and used that to define the graphics layer.

We can't upgrade beyond 10.1 just yet. Hopefully this helps someone.

0 Kudos