Basic Viewer Print Widget in IE

10449
28
12-17-2014 10:31 AM
PaulHoeffler
New Contributor II

The print widget on the basic viewer produces output most of the time on Firefox and Chrome, but on IE the button does nothing and looking in the logs the following error is registered:

Error: esri.config.defaults.io.proxyUrl is not set. If making a request to a CORS enabled server, please push the domain into esri.config.defaults.io.corsEnabledServers.

I'm not using a proxy server and the print service that I'm using is on the same domain as the viewer.

Any thoughts on how to avoid the error and get the print widget working?

Thanks in advance,

Paul

0 Kudos
28 Replies
PaulHoeffler
New Contributor II

I appreciate all the background information on cross-domain issues. 

That being said, I believe this is a bug, as I am not using a proxy and the viewer and the print/web export service are on the same domain yet the browsers throw a proxyURL not set error. The print widget works on the second attempt on Chrome and Firefox, but not the first attempt and not on IE.

The proxyURL is not set because I am not using a proxy and I cannot use a proxy at this time. I suppose it's possible that the print widget is designed only to work with a proxy even if the viewer and print/export service are not cross-domain, but I don't understand why that would be the case.

I'll call support when time allows and report back.

Thanks for the resources regarding the various issues at play here, I hope that I haven't been unclear or that I am not fully understanding why the print widget works inconsistently within our domain.

0 Kudos
RobinWhite
New Contributor III

I have encountered this same issue in a modified version of the basic viewer and associate with a widget in Web AppBuilder that writes a set of selected records to a .csv file.  These worked in Chrome, and Firefox but not in Internet Explorer v. 11.  I discovered that reverting security setting to default values fixed the problem.   But, this is only a guess!

0 Kudos
GabiVoicu
Occasional Contributor

I'm facing a similar issue with Print widget not able to print using IE 11 though (not necessarily a bug for IE 9), here is our link;

http://gismaps.collincountytx.gov/main103.html

printing just fine using Chrome or Firefox

Would love to hear if anyone found a workaround or experiencing similar behavior!

Thank you

Gabi Voicu

0 Kudos
ChrisSmith7
Frequent Contributor

It looks like it's working for you now. I had a similar issue in IE11 when the doc mode was set to IE9, and also in IE9. Print was working fine in FF, Chrome, Safari, and IE10+ (when not using IE9 doc mode).

The problem ended up being that I was using a remote proxy, with cross-domain headers in the web.config, so the remote proxy worked just fine in browsers with CORS; however, because the proxy itself required CORS to be served-up, non-CORS browsers (IE9, for example) failed with "access denied." The proxy worked as designed in posting the large json value, but only if the browser was CORS-enabled.

It took me awhile to realize this, but simply moving the proxy to the application server resolved the "access denied" issue. In my case, I had an application at domain1, a GIS Server at domain2, and a proxy on the web adaptor server, domain3. Embedding it in the application on domain1 (referencing via a relative path) removed the need to serve-up the proxy using CORS - now it works as a CORS workaround AND as a 2048 char workaround!

It should be noted that IE8/9 actually has partial support for CORS, but through XDomainRequest, not XMLHTTPRequest. XDomainRequest isn't supported by the dojo toolkit, hence the need to use a proxy.

GabiVoicu
Occasional Contributor

It is working if you do not try to print after an address search that adds a graphic (point) on top of the map – so only in this particular scenario (graphic added) is Not printing (or parcel identifier)  !

.........................insert

Wait a sec.....actually your comments made me think about my meta-tag in my html doc to emulate IE- ERIKA !- that was it !

Removed that tag - worked just fine - you are awesome - thank you a thousand times !

.........................end insert

Thank you so very much for your input – it sounds pretty complicated between all those three different domains and proxy and CORS etc…

I wish I knew just a bit more about proxy since another error that I keep getting whenever trying to move our app on a different web server is exactly that related to the proxy somehow and...sure enough graphic again

Here is my other domain gis.collincountytx.gov with an election app:

http://gis.collincountytx.gov/electionpollingplace/

Error pasted here:

Unable to draw graphic (null): Unable to load proxy.ashx?http://gis.co.collin.tx.us/arcgis/rest/services/election/ed/FeatureServer/0/query?

f=json&where=1%3D1&returnGeometry=true&spatialRel=esriSpatialRelIntersects&outFields=*&outSR=102100 status: 500

Thank you

0 Kudos
RobertMaiden
New Contributor III

I see the same thing in IE10.  I do not get layers visualized as I do in Chrome and Firefox.  Meanwhile the console messages is as follows:

TypeError: Unable to draw graphic (null): Object doesn't support property or method '_ioSetArgs'TypeError: Unable to draw graphic (null): Object doesn't support property or method '_ioSetArgs'

See also

Problems Loading Basemaps and Layers in IE10

0 Kudos
ChrisSmith7
Frequent Contributor

Gabi,

Something else you may want to try for the "unable to load proxy" error is to set mustMatch="true" to mustMatch="false" temporarily in the proxy.config file (I'm using the IIS/.NET version). If it works after doing that, double-check your serverUrl entries and make sure the server you need to proxy is listed and that it is correct... something like:

    <serverUrl url="http://mygisserver.com/arcgis/rest/services"

               matchAll="true"></serverUrl>

matchAll indicates that all services at the rest/services root will be allowed.

Remember to set mustMatch back to "true" after you're done testing. Also, one last thing to double-check, make sure allowedReferers contains the list of URLs that are allowable as the referrer, e.g. the address of the application that hosts the map, for instance, or another site that can consume the services. You can send multiple URLs as a comma-delimited list, or you can simply set it to "*" if you have too many apps to list and it's safe for anyone to access.

Hope this helps!

GabiVoicu
Occasional Contributor

Chris, thanks a bunch again for looking into it !

I'm not sure where is this tag or where/how should I add it allowedReferers ....

Chris, our app is working just fine on this other old web server where we have Windows Server 2008 R2 on it

working here (2008 R2)

http://gismaps.collincountytx.gov/electionpollingplace/

.....but we would like to move it on this newer server with Windows Server 2012 R2 on it and that is when the problem occurs ! The app has been developed from an ESRI ArcGIS Local Gov template - election polling place and requires .NET Framework 4.0 and the Windows Server 2012 R2 says it only has .NET Framework 4.5 (but somehow backwards compatible ???!!!)

here are is how our proxy looks like

on both web servers

(not working here 2012 R2)

http://gis.collincountytx.gov/electionpollingplace/

Thank you

  <serverUrl url="http://gis.co.collin.tx.us/arcgis/rest/services" matchAll="true"></serverUrl>
  <serverUrl url="http://tasks.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>
  <serverUrl url="http://sampleserver6.arcgisonline.com/arcgis/rest/services" matchAll="true"></serverUrl>
  <serverUrl url="http://geocode.arcgis.com/arcgis/rest/" matchAll="true"></serverUrl>
 

<serverUrl url="http://route.arcgis.com/arcgis/rest/" matchAll="true"................

........................................................................................................

  <serverUrl url="http://server.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>
  <serverUrl url="http://services.arcgisonline.com/ArcGIS/rest/" matchAll="true"></serverUrl>
  <serverUrl url="http://serverapi.arcgisonline.com/jsapi/" matchAll="true"></serverUrl>

  </serverUrls>

0 Kudos
ChrisSmith7
Frequent Contributor

On the map that's failing, it looks like you get the 500 error on:

http://gis.collincountytx.gov/electionpollingplace/proxy.ashx?http://gis.co.collin.tx.us/arcgis/rest...

The proxy target link works fine... I think if you had a problem with the serverUrl tag, you would see a 403 error instead of a 500 error. .NET 4.5 should be fine, but you may have some things that are needed in IIS - If you haven't come across this thread yet, there's some info on that in Unable to load proxy

Sometimes, firewalls can block the traffic as well. I would also recommend trying to debug your proxy... I'm not sure how your dev environment is set-up, but if you have it open in Visual Studio, you can attach to process, or, you should be able to force it by adding the following line wherever you need it:

System.Diagnostics.Debugger.Break();

I had a problem with the proxy back in 2013 and added that line in the ProcessRequest method to discover an issue when proxying https. This was later fixed with v1.0, which is something else you may want to try. If you're not using the latest proxy, you can find it here:

Releases · Esri/resource-proxy · GitHub