Select to view content in your preferred language

ArcGIS Server Print Task is unable to access the map services using the local IP address

957
11
01-08-2024 04:12 AM
MamoonRasheed
New Contributor

I have Print and Map Services on the same physical server and a web application (developed using ArcGIS Javascript 3.x API) also deployed on the same server. Web application consumed both print and map services. When a Print Task request is sent to the server using LiveIP, at that moment Print Task created JSON. This JSON has Map service with LocalIP because now the request is on the server and it needs to use Map service so Map service should have LocalIP in JSON. Previously it was working fine but suddenly, the print task stopped accessing map services from the local IP.

For testing, I tried to access map services from another live server, map services were accessible and the print task did print.

The problem is, how can I access map services using local IP instead of LiveIP

0 Kudos
11 Replies
TanuHoque
Esri Regular Contributor

@MamoonRasheed 

I'm interested in knowing why you need to use local ip address? 

0 Kudos
MamoonRasheed
New Contributor

Dear TanuHoque,

Thanks for your interest.

Actually, Print task and Map Services are on the same physical server. The print task (through JSON) is not able to get map services from the same server whereas map services are accessible through another live server. Previously it was working with LocalIP that's why I was looking solution with LocalIP.

At this moment I can rephrase the problem that how can I access map services through Print Task at the same physical server. it can be through LocalIP or LiveIP.

0 Kudos
Noah-Sager
Esri Regular Contributor

@MamoonRasheed, I think Tanu was asking why you want to use an IP address in your workflow.

0 Kudos
MamoonRasheed
New Contributor

@Noah-Sager, can you correct the workflow to get solution of said problem?

Thanking you in advance.

0 Kudos
MamoonRasheed
New Contributor

@Noah-Sager, using IP address to access map services through PrintTask is not mandatory. The problem is to get a print of the operational layers through the map service. If you can suggest any changes I will be grateful to you.

Whereas I tested PrintTask services in the following ways.

1- https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer       (Successful)

2- https://localhost:6443/arcgis/rest/services/<servicesName>/MapServer/1      (UnSuccessful)

3- https://LocalIPAddress:6443/arcgis/rest/services/<servicesName>/MapServer/1      (UnSuccessful)

4- https://<LiveIPAddress>:6443/arcgis/rest/services/<servicesName>/MapServer/1      (UnSuccessful)

5- https://<DomainName>:6443/arcgis/rest/services/<servicesName>/MapServer/1      (UnSuccessful)

In all above mentioned cases log shows the following error message

Error executing tool. Export Web Map

Failed to create layer from service at <complete service path>

0 Kudos
MamoonRasheed
New Contributor

Correction: In all above mentioned unsuccessful cases log shows the following error message

0 Kudos
TanuHoque
Esri Regular Contributor

Thanks @MamoonRasheed @Noah-Sager 

@MamoonRasheed

the reason https://<LiveIPAddress>:6443 doesn't work is because most likely you don't have valid certificate. As you know, a valid certificate is needed for any https:// protocol, otherwise client app (like web browser or Pro) will ask you as a user to accept that invalid certificate. In case of print service, the job simply fails.

I'd recommend you install ArcGIS Web Adaptor, configure that to you server and have a valid certificate install. After that the url of your services will look something like https://<machine_name>.<domain_name>.com/arcgis/rest/services .... and use this new urls in your web app; that should resolve this issue for you as that is the right thing to do... and you don't need to worry about using local-host or local-ip-address.

hope this helps

Tanu

0 Kudos
MamoonRasheed
New Contributor

@TanuHoque ,

SSL certificate is valid up to November, 2024 and configured through domain name instead of IP. So map services are accessible through the domain name URLs when directly accessing through the web browser with a valid certificate message in the browser (See Attachment SSLCertificateDetail.png). However, the problem is map services are not accessible through PrintTask. Moreover, map services are secure and a Token is also passed in "Web Map as JSON" (PrintTask JSON). (See Attachment JSON-1.png and JSON-2.png). SSLCertificateDetailSSLCertificateDetailJSON-1JSON-1JSON-2JSON-2

 

You can see in the attached images that for testing purposes I am trying to get print from the printTask without using our custom web application but no luck so far. Once I get print directly from the PrintTask most probably it will work through a custom web application.

Moreover, according to my understanding, ArcGIS Web Adaptor is not mandatory for using the PrintTask in ArcGIS Server. The PrintTask is a server-side task that allows you to generate print layouts and export them as images, PDFs, or other formats. It is part of the ArcGIS Server REST API. whereas, ArcGIS Web Adaptor, on the other hand, is a separate component used for integrating ArcGIS Server with your existing web server infrastructure. It helps improve security and provides a convenient way to use your organization's web infrastructure for hosting the ArcGIS Server services. Please correct me if I am wrong.

Can you let me where I can get ArcGIS Adaptor?

Regards,

0 Kudos
TanuHoque
Esri Regular Contributor

@MamoonRasheed 

Thanks for clarifying. Sorry that I wrongfully assumed you didn't have valid certificate for your :6443 port. You are right about other things you mentioned about web adaptor.

Can you pls do me a favor?

  • pls log (remote or physically) on to your server machine, where the print service runs as the ArcGIS SOC user
  • open a web browser (maybe in Incognito mode to avoid any local cache)
  • try to access your map services https://<domain-name>:6443/arcgis/rest/service/<service-name>/MapServer
  • see if you can access this url w/o get prompted for anything
  • if you happen to have ArcGIS Pro installed on that server machine, I'd like you to access your map service the same way in Pro. And see if you can access that w/o getting prompted with any dialog box or anything.

 

 

 

0 Kudos