I used a secured web printing service in a custom application developed using ArcGIS JS API. It was working fine and was printing all layers present on the map. However, recently I started receiving 400 and 500 errors while executing the print functionality.
Issue 1: FeatureLayer, MapImageLayer, and GraphicsLayer are displayed on the map with ArcGIS Online basemap imagery as the basemap. When executing the print, it gives the error: Unable to complete the operation (400). Whenever I exchange the imagery with another basemap, like the Light Gray Canvas, the service generates a map. After inspecting the Server Log, I cannot connect to the ArcGIS Online imagery service due to an invalid certificate error, as seen in the image below.
Issue 2: There is a result graphics layer where I add features intersecting with the users' input feature. The print functionality works whenever the result has a few features added to the layer. But when there are many intersecting features in the result layer, the print function gives a 500 (Internal Server Error), as seen in the image below.
If I hide the results layer, the print functionality works again, so it seems like there is a problem with the result layer, but I am not sure what it is. Is there a limit to the number of features the print function can print?
The print service is published as a secure service on a standalone ArcGIS Server instance of version 10.6.1
for the first issue, this what I'd recommend you to do:
on the 2nd one:
- do you have any proxy server in between your webapp and the print service?
one thing you can do is this:
I hope you will find this helpful.
@TanuHoque Thanks for the reply.
- try to access services from https://services.arcgisonline.com/ArcGIS/rest/services without it prompting you accept some certificates.
- if it asks for certificates to accept or you can't access for some reasons, you need to check with your network/system admin to resolve this from your side.
After talking to the network department about the ArcGIS Online URL, I opened it in an incognito window on my server where our ArcGIS Server is residing. It opened without prompting to accept the risk of no/invalid certificate.
So I guess the issue is resolved for now. Is there a way to permanently add this to a whitelist that will trust this link directly and not prompt the user for invalid certificates?
For the second issue,
- do you have any proxy server in between your webapp and the print service?
I do have a proxy server which I use to access these services. I used the urlUtils' addProxyRule method to add the service URL to our custom application.
I found the 'WebMap_as_JSON' and other parameters inside the error response.
Copied these parameters to the service in ArcGIS Server.
Getting a blank screen after pressing the Execute Task (GET) button, as shown below.
I also inspected the developer tool, and it is blank. What does this infer?
The same service generates results with the same layer but with lesser features in the result layer.
Can this be an issue with the webserver where the proxy application is hosted?
I came across this post and modified some IIS configurations, like 'maxAllowedContentLength' and 'uploadReadAheadSize,' but still, the issue persists. The adjusted values can be seen below.
There is another post suggesting modifying server properties, like 'maxPostSize ', 'socMaxHeapSize', and 'appServerMaxHeapSize.' Will changing these properties affect the issue I am facing?