Loading Dynamic KML from web service

Discussion created by derickson48 on Oct 19, 2011
Latest reply on Jan 22, 2013 by stevemclesri
I am attempting to use ArcGIS API for Javascript to view KML from a dynamic REST webservice of a 3rd party app server that I control.  To test this I have downloaded the html source for the KMLLayer example and am modifying the kmlUrl variable to hit my service.

var kmlUrl = 'http://localhost:6040/service/query/etc/1.kml';
var kml = new esri.layers.KMLLayer(kmlUrl);

The data does not appear.  However, if I download the URL to a static KML file and upload that to a public file webhosting (in this case my public DropBox) and then adjust the code to pull from the static URL hosting location, it works just fine.

Could the localhost or high number port be causing the problem?
Could any HTTP response headers mess up the KMLLayer constructor?  The webserver is setting the content type to "application/", which I believe is correct.

Thanks in advance for help,