Custom Print Service

3731
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
1 Solution

Accepted Solutions
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.

View solution in original post

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

Hi Ashley,

Is your print service is public facing or just localhost?

Why don't you try this print sample to see if you can print using your service:

Print templates with esri.request | ArcGIS API for JavaScript

Then using the developer tool from browser to compare the difference behavior from the sample print service versus yours.

0 Kudos
AshleyPeters
Occasional Contributor III

Hi Yue,

I tried the print sample and exchanged my custom print service for the service provided. My print service did not work.

Ashley

0 Kudos
AshleyPeters
Occasional Contributor III

Also, when I try to use my print service, I am receiving a CORS error, but I do not receive that error on my own projects. When I add in CORS to my config file, the print widget doesn't even try to run.

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Would you please share with us about your print service url so that I can test with it?

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ashley,

I found the reason is because your print gp service is setup as Asynchronous

You can find in this parameter in your url

Execution Type: esriExecutionTypeAsynchronous

I am not really sure do you need asyn or not, but nevertheless, if you prefer to use asyn Execution, you need to add this line of code in print widget, based on the documentation: Print | API Reference | ArcGIS API for JavaScript  (search "async" you will find it)

Therefore, in the print template sample, if you add your print service url you also need to add line 03:

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

Hope this can help.

Roll Tide!

0 Kudos
AshleyPeters
Occasional Contributor III

Hi Yue,

I've been out of the office for a few days, I'm sorry I'm just getting back to you. I do have "async" set to true in the print option of my code. I'm looking into whether or not I need to define templates. This is a screenshot of my log file from last week. I've got to look into these, as this may be the overall issue:

Screenshot.jpg

0 Kudos
YueWu1
by Esri Regular Contributor
Esri Regular Contributor

Hi Ashley,

The easiest way to test with your GP Service is editing this sample in this sandbox. I remember last week I tested with your Print service with this sample and it works fine. And I think you do need define your template.

0 Kudos
AshleyPeters
Occasional Contributor III

Yue,

I've testing in the sandbox with my print service. It's registering my templates, but I still do not get a printout.

0 Kudos