Printing Secured Servies with Export web map task

6525
8
03-15-2013 09:54 AM
TracyArchibald
Occasional Contributor
We've created a toolbox to print the secured service as per these instructions:
http://resources.arcgis.com/en/help/main/10.1/index.html#//0154000005q3000000

Since we're testing, I used my permissions, which are listed as admin.

I'm getting the following errors:
Layer "layer0": Unable to connect to map server at <Secured Service URL>
Layer "graphicsLayer4": Failed to create layer from service at <Secured Service URL>

We're using Window's Users.

We've recreated the toolbox and tried a couple other user's permissions (just to test) and still have the same issues.  I know it's
something that people have done successfully, so there's got to be a solution.

Any ideas what I could try?
Tags (2)
0 Kudos
8 Replies
nicogis
MVP Frequent Contributor
Tracy, can you describe your steps because seems (seeing error) that you haven't permission for services contained in webmapjson
0 Kudos
TracyArchibald
Occasional Contributor
What other steps do you need?

All the services (including the secured print service) are on the same 10.1 server. 
I am currently the main admin, so my user has full permissions to everything. 
We followed the steps in the help document (see above) to be able to print the secured services at least 3 separate times to ensure we didn't miss anything.
The code I'm using to print is based off of this example: http://help.arcgis.com/en/webapi/javascript/arcgis/jssamples/widget_print_webmap.html
I swaped the URL in the code with the secured print service URL so it's looking at the correct export tool.
The Export Map service for secured services is running and accessable.

I'm not sure what else to check or try.
0 Kudos
nicogis
MVP Frequent Contributor
the widget generates webmapjson. Have you tried copy webmapjson in page rest of tool and see the results? Have you made connection using web adaptor or direct web server arcgis server for the tool?
0 Kudos
TracyArchibald
Occasional Contributor
Sorry I haven't replied sooner, I had some more critical things come up...

The JSON request is being truncated by the tool I'm using to get it.  Do you have a suggestion for a tool that will let me grab it all?

the JSON response from the server is:{"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool."]}}

I'm running through a proxy, which shouldn't be an issue...
0 Kudos
nicogis
MVP Frequent Contributor
Tracy, I don't understand: what's meaning for truncate?
do you open the tool in arccatalog and copy the json web map in textbox of form tool gp for webmap json?
0 Kudos
ShaunWeston
Occasional Contributor
I'm facing the same issue with export web map service and secured services.

So the layers in your web map are they using a token to authenticate?

To see web traffic between you and the print service you can use fiddler (http://www.fiddler2.com/fiddler2/) and turn the logging of the export web map tool to Info
0 Kudos
TanuHoque
Esri Regular Contributor
Tracy,
It seems like the GP Tool has a limit on how long the text can be in the text box.

I'd suggest you to execute the tool from the Python Window in ArcMap like this:

yes, there are 3 double-quotes on both sides of the string below
>> j = """<this is where your webmap_as_json would go>"""

if the webmap_as_json string is way too long, you can have it saved as a text file and use the following python functions (which I'm pretty sure you know of) to read it in the memory.
>> j = open(r'<file_name_including_full_path').read()

now execute the exportwebmap tool and output as a png8
>> arcpy.ExportWebMap_server(j, r"c:\temp\temp.png", "PNG8")


another option would be to use ConvertWebMapToMapDocument() function to save that out as a mxd and open that.
>> o = arcpy.mapping.ConvertWebMapToMapDocument(j)
>> o.mapDocument.saveACopy(r"c:\temp\test.mxd")

now, open that in ArcMap and see whether all layers draw.
0 Kudos
TracyArchibald
Occasional Contributor

Just in case anyone is still looking, our problem still exists.  Here's where we are at now..

We can print ANY non secured service just fine.

We can occasionally (when the stars align, or we sacrifice a goat or some other strange occurrence) print secured services.

What we have done:

We are right up to date with 10.2.2 which helped.  One of our main users had a "-" in it so we needed a patch.

I managed to get the JSON for a handful of layers so I can paste it directly into the REST end point and it still fails.

We republished the service as per: ArcGIS Help (10.2, 10.2.1, and 10.2.2) And it still fails.

What we are currently investigating:

Web Tier authentication (we have doubts it will work with our security and data accessibility mandates though).

The core of our problem seems to be that we have a publicly accessible webmap that uses a handful of layers that need to be secured (so people can't scrape the data for themselves), but don't need to have a login for the map.  We are pretty sure we can get it to work if we make everyone log in, but it isn't feasible for a public map. 

0 Kudos