Problem with Print Dijit

832
4
09-10-2012 01:10 PM
by Anonymous User
Not applicable
Attempting to use the "Print Dijit Print Templates Created Using esri.request" sample.

Within the init function I have the prescribed code:

var app = {};
      app.printUrl = "http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%2...";


var printInfo = esri.request({
          "url": app.printUrl,
          "content": { "f": "json" }
        });
        printInfo.then(handlePrintInfo, handleError);

However the "handlePrintInfo" function does not fire. Any ideas why? And yes, I do have the function defined further down in the code.

Thanks!

RGibson
0 Kudos
4 Replies
JianHuang
Occasional Contributor III
Make sure you set the proxy page correctly.
0 Kudos
by Anonymous User
Not applicable
Make sure you set the proxy page correctly.


Thanks for your reply, Jian.

I have this....

esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";

Is that correct?

RGibson
0 Kudos
DuncanNisbett
New Contributor
Thanks for your reply, Jian.

I have this....

esri.config.defaults.io.proxyUrl = "/arcgisserver/apis/javascript/proxy/proxy.ashx";

Is that correct?

RGibson


If that's the directory structure where your proxy file is stored, then yes. However, most likely your directory structure is not exactly the same as the sample files. So in your web directory you need to find where you have your proxy file stored and then reference that path where you are setting the proxy using esri.config.defaults.io.proxyUrl.

Here is an example. I have a website stored in a folder called testmap, within that folder I have another folder called proxy and inside that proxy folder I have a file called proxy.ashx. Then I would use the below in my JS file to set my proxy path.

esri.config.defaults.io.proxyUrl = "/testmap/proxy/proxy.ashx"; 


Hope this helps.
0 Kudos
by Anonymous User
Not applicable
Sorry. Pasted wrong line.

Yes, I have the following:

esri.config.defaults.io.proxyUrl = "/javascript/proxy/proxy.ashx";

And I have created an application from that physical path in IIS.

And I've edited the proxy.config to allow services from my server: 
<serverUrl url="http://myserver/ArcGIS/rest/services/"
               matchAll="true"></serverUrl>
0 Kudos