Custom Print Service

3838
17
Jump to solution
02-18-2016 09:18 AM
AshleyPeters
Occasional Contributor III

All,

I have a project that is working beautifully, except for my print widget. At this point, it is the one thing that is keeping me from releasing my project.

I created a custom print service, following this tutorial: Tutorial: Publishing additional services for printing—Documentation | ArcGIS for Server . The folder holding my custom templates is registered and is validated.

Within my code, I can replace the call to my custom print service with someone else's and their service works, but mine doesn't. All settings are the same between the two. The one obvious difference is that his is http, vs. mine being https. When my code is set to look to my print service, the print widget when clicked goes from Print, to Printing, but I never get Printout.

Firefox's Developer Tools are not throwing any errors when I run the tool, so I'm not sure where to go next.

Has anyone else run into this? Or have any ideas on how to solve it?

Thanks in advance!

Ashley

0 Kudos
17 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ashley,

Two thing you need to change from this sample: Print templates with esri.request | ArcGIS API for JavaScript

1. Enable CORS or add proxy:

        //esriConfig.defaults.io.proxyUrl = "http://yourproxy/proxy.ashx";
        esriConfig.defaults.io.corsEnabledServers.push("conservationgis.alabama.gov");

2. Like I mentioned, or you may already did it:

 app.printer = new Print({
            "map": app.map,
            "async": true,   

And it should work.

Here is the screenshot that using your print service.

0 Kudos
AshleyPeters
Occasional Contributor III

I have a single machine setup. As soon as I enable CORS, I get errors galore that I wasn't getting. And my understanding has been I do not need a proxy since I have the single machine setup. Is that incorrect?

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

If your machine is same domain with your print service then you don't need to. The reason I need is because my domain is out of your print service domain.

0 Kudos
AshleyPeters
Occasional Contributor III

So what else do I need to try? I need to get this working. I'm still getting the same errors on my server logs like I posted above. And, if it makes a difference, the internal and external IP addresses on the server are different.

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ashley,

Try to follow this documentation to setup a proxy Setting up a Proxy | Support Services Blog

If you still encounter any issues you can try to contact Esri Technical Support and we would definitely love to help you resolve this problem.

0 Kudos
AshleyPeters
Occasional Contributor III

Hi Yue,

I actually contacted Tech Support yesterday. We haven't been able to get this resolved yet, but I hope we can soon. I really need this to work!

Thanks for your help so far!

Ashley

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

It's my pleasure.

I wish I can help you in person and this should be fixed easily.

Feel free to share this information to the analyst that you work with and it will definitely helps.

Best Regards,

0 Kudos
AshleyPeters
Occasional Contributor III

I finally got this resolved this morning. I have recently undergone an upgrade to 10.3.1. My SOC account could not hit my FQDN (fully qualified domain name). Phillip, the Esri tech analyst, had me sign on to my server as the SOC account and try to hit my REST services. I was unable to do that. That narrowed it down to one of two options. In Phillip's words:

"Depending on your network configuration this could be a example of network hairpinning. "Because an origin endpoint and its router in a subnetwork may not recognize that a message is intended for a destination endpoint in the same subnetwork because it only knows its public IP  address, the Internet Network Address Translation (NAT) server must be able to recognize the situation and hairpin the message back to the subnetwork so that it can reach its destination."

It could also be a result of permissions given to the local user on the server.  If this is the case your IT could potentially change those permissions or set up a domain account to run the ArcGIS Server service. "

I forwarded his message on to my IT folks, and they made a change in the host file. Problem solved! Hopefully this will help someone in the future.

0 Kudos