In the sample you posted, the status will never be 200. It's been a while since I've manually sent an XMLHttpRequest but I think you need to set the onload property to a function that will be called when the response is received. I would recommend using esri/request for HTTP requests if that's possible. send ( ) //console.log(http.status) if (http. open ( 'HEAD', reportPath, false ) //tRequestHeader('Access-Control-Allow-Headers', '*') Var http = new XMLHttpRequest ( ) var contentResult = "" This checks to see if the report has already been generated, and if so, returns it to the popup. I think the section that's causing all the errors is below. I wrote everything in ArcGIS-JS-API, yes. I tried adding the URL of our webserver and it didn't help.ģ. Yes, they are on the same Windows Server 2012 machine.Ģ. I'm pulling my hair out trying figure this out.ġ. Origin 'null' is therefore not allowed access." I've also tried removing these lines from the webconfig and adding " Access-Control-Allow-Origin, * " under HTTP response headers in our IIS web server manager and I get this error "The 'Access-Control-Allow-Origin' header contains multiple values 'null, *', but only one is allowed. I tried adding this to my JavaScript code and it worked in once instance, but not another.Į.corsEnabledServers.push("") I've tried adding this to our webconfig file, and it doesn't help. I get the CORS error when the server tries to return the report PDF to the popup in the map window. I have a geoprocessing tool on the ArcGIS server that generates a report from a map click. I've been dealing with this issue for a while.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |