Flex Viewer Print Widget Using ESRI v10.1 Print Service

4814
11
Jump to solution
12-13-2012 07:12 AM
MichaelVolz
Esteemed Contributor
To All Flex Viewer Users:

I have a FlexViewer application that uses my organizations AGS v10.0 mapservices.  In order to get a better quality printout I am trying to use ESRI's printing service.

As such, I have configured the Print widget to use ESRI's v10.1 Print service as follows:

<taskurl>http://sampleserver6.arcgisonline.com/ArcGIS/rest/services/Utilities/PrintingTools/GPServer/Export%2...</taskurl>

I then tried to create a pdf print with this task from my internal FlexViewer app but I received the following results:


Error executing print task:

[RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail="Error executing tool.: Layer "BaseMap AdminBoundaries C StPl FileGeo": Unable to connect to map server at http://myserver/ArcGIS/rest/services/MapServices/BaseMap_AdminBoundaries_C_StPl_FileGeo/MapServer.
Layer "BaseMap Hillshade Aerials 2010 C StPl FileGeo": Unable to connect to map server at http://myserver/ArcGIS/rest/services/MapServices/BaseMap_HillshadeAerial2010_C_StPl_FileGeo/MapServe....
Layer "BaseMap RoadsRiversRailStreams C StPl FileGeo": Unable to connect to map server at http://myserver/ArcGIS/rest/services/MapServices/BaseMap_RoadsRiversRailStreams_C_StPl_FileGeo/MapSe....
Layer "BaseMap AdminBoundaries C StPl FileGeo": Unable to connect to map server at http://myserver/ArcGIS/rest/services/MapServices/BaseMap_AdminBoundaries_C_StPl_FileGeo/MapServer.
Layer "Parcels Search D StPl FileGeo": Unable to connect to map server at http://myserver/ArcGIS/rest/services/MapServices/Parcels_Search_D_StPl_FileGeo/MapServer.
Layer "Road Alias Join D StPl FileGeo": Unable to connect to map server at http://myserver/ArcGIS/rest/services/MapServices/Road_Alias_Join_D_StPl_FileGeo/MapServer.
Layer "hiddenLayer_Parcels": Failed to create layer from service at http://myserver/ArcGIS/rest/services/MapServices/Parcels_Related/MapServer/0.
Failed to execute (Export Web Map).
Failed to execute (Export Web Map Task)."]

I am able to see these layers in my application, so it would appear to me that the problem is that these layers can not be seen by ESRI's external server.  Is this the correct interpretation of this error message?

If this is the case, it means that the mapservices need to be publically accessible so the data can be sent to ESRI's print server where the pdf is created?

Any help or feedback is greatly appreciated.  Thank you.
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Michael,

   You are correct for you to use esri's print service your map services would have to be publicly accessible.

View solution in original post

0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus
Michael,

   You are correct for you to use esri's print service your map services would have to be publicly accessible.
0 Kudos
MichaelVolz
Esteemed Contributor
Thank you for that confirmation Robert.

One other question about the Print widget.  Is there any way to get the widgets such as the Identify widget with its results to get added to the pdf that is generated on ESRI's server?  When I create a pdf now with a widget visible, the generated pdf does not show the widget.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michael,

   I have guided some people (pre-10.1 print widget) in how to do that but it is not a standard practice at all. There is alot of coding changes and I have not attempted in 10.1.
0 Kudos
MichaelVolz
Esteemed Contributor
Is this an Enhancement to your widgets that you would consider adding so that your widgets would be available to be added to the pdf file that is created as part of the ArcGIS Server v10.1 Print task?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nope, it would require Mods to the esri print widget not the other way around.
0 Kudos
CereusGraphics
New Contributor
What is the best process by which the error can be detected for the print service?
0 Kudos
EricGardecki
Occasional Contributor
Can you clarify your question?
0 Kudos
AaronKreag
Occasional Contributor
This print service is hosted on the Amazon Cloud (Amazon AWS).  If you have an IT team that is monitoring web traffic, sometimes they will notice that you are getting a lot of traffic from these IP addresses such as 174.129.18.254

This IP address is where the print service is coming from.  So anyway, IT doesn't see that its ESRI, just Amazon and the IP address ends up blocked by IIS, you will get that error.  Some companies have it set up to block IPs automatically based on some kind of algorithm.

I also think there is something to do with the URL for your mapservice and the case sensitivity of the URL, make sure that's all well and good.

I end up seeing errors in the Print tool when there are more than 1000 features in my map view or if my map service is under heavy load and its not responding fast enough.  So you will have to zoom into a closer area to get that print tool to work correctly.

Lastly, if you have data in the map that is scale dependent, I noticed that I would get print errors if the user was not zoomed in close enough to have all of the layers active.  For instance at the initial view, if it was just a basemap and no dynamic content it would fail.  Clearly very moody this thing....
0 Kudos
EzequiasRodrigues_da_Rocha
New Contributor III
I am having this error even using local Printing task

[RPC Fault faultString="Unable to complete operation." faultCode="400" faultDetail="Error executing tool.: Layer "Oceanos": Unable to connect to map server at http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer.
Failed to execute (Export Web Map).
Failed to execute (Export Web Map Task)."]


I am using Ocean as a Basemap (without the MapSwitcherWidget) on the following tag:

<basemaps>
<layer type="dynamic" label="Oceanos" url="http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" visible="true" reference="false"/>
</basemaps>
or
<basemaps>
<layer type="tiled" label="Oceanos" url="http://services.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" visible="true" reference="false"/>
</basemaps>
Is that really the correct url?

Any suggestion?

Regards
Ezequias Rocha
0 Kudos