The error:
{"error":{"code":400,"message":"Unable to complete operation.","details":["Error executing tool. Export Web Map Job ID: j56ff7247723a48e89f247ed4dfbb5d70"]}}
The scenario:
- Local on-premise Portal for ArcGIS with federated ArcGIS Server
- Webmap which contains secured and shared on-premise map service and a remote secured map service. The remote map service is from ArcGIS Server that is not federated with their Portal for ArcGIS
- The local on-premise print geoprocessing service uses the same security as the local map service
- A resource proxy is used for both services - on-premise and remote.
- The local map service uses OAuth2 available via the proxy:
<serverUrl matchAll="true" url="https://my.webadaptor.com/portal/"
clientSecret="0dc210d467eat2me9e1a628767cec48b"
clientId="MetY25mamaH20GSm"
oauth2Endpoint="https://my.webadaptor.com/portal/sharing/oauth2/"/>
- The remote map service uses token authentication available via the proxy:
<serverUrl matchAll="true" url="https://their.remoteserver.com" username="TheirUsername" password="TheirPassword!"/>
- The JSAPI code adds the proxy rules via esri/urlUtils:
urlUtils.addProxyRule({
urlPrefix: "https://their.remoteserver.com/",
proxyUrl: "my.webadaptor.com/dotnetproxy/proxy.ashx"
});
urlUtils.addProxyRule({
urlPrefix: "https://my.webadaptor.com/",
proxyUrl: "my.webadaptor.com/dotnetproxy/proxy.ashx"
});
- The URL via the proxy returns with the response above:
https://my.webadaptor.com/dotnetproxy/proxy.ashx?https://my.webadaptor.com/arcgis/rest/services/Proj...
- When I connect to the respective REST catalogs I can successfully export with map services to graphic output.
The webmap is created using the usual arcgisUtils.createMap method. The print dijit is created using the method shown in the sample:
Print webmap | ArcGIS API for JavaScript 3.18
In fact, if I modify the code in the sandbox to consume my webmap and use my proxy, it successfully generatesthe print if I use the Esri-host print geopocessing service. If I use my locally-hosted print geoprocessing service, the print fails with the same error shown at the top.
So the question is, why can I not do this from my on-premise AGS + Portal?
TIA