Note that there are some explanatory texts on larger screens.

plurals
  1. POI cannot seem to load an XML document using ASP (Classic), IIS6. Details inside
    primarykey
    data
    text
    <p>So I am writing a web application for use within my organization. The application requires that it know who the current user is. This is done by calling the Request.ServerVariables("AUTH_USER") function, which works great as long as 'Anonymous Access' is disabled (unchecked) and 'Integrated Windows Authentication' is enabled (checked) within IIS for this subweb.</p> <p>Unfortunately by doing this I get an 'Access Denied' error when I hit the load method of the XML DOM. </p> <p>Example code:</p> <pre><code>dim urlToXmlFile urlToXmlFile = "http://currentwebserver/currentsubweb/nameofxml.xml" dim xmlDom set xmlDom = Server.CreateObject("MSXML2.DOMDocument") xmlDom.async = false xmlDom.load( urlToXmlFile ) ' &lt;-- this is where I get the error! </code></pre> <p>I've looked everywhere and cannot find a solution. I should be able to load an XML file into the DOM regardless of the authentication method.</p> <p>Any help would be appreciated. So far the only two solutions I can come up with are:</p> <p>a) create a new subweb that JUST gets the current user name and somehow passes it back to my XML reading subweb.</p> <p>b) open up security on the entire system to 'Everyone', which works but our IS department wouldn't care for that.</p> <p>=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=</p> <p>Here was my original code, which cause the access denied error:</p> <pre><code>dim urlToXml urlToXml = "http://someserver/somesomeweb/nameofxml.xml" dim xmlDom set xmlDom = Server.CreateObject("MSXML2.DOMDocument") xmlDom.loadXML( urlToXml ) dim xsl set xsl = Server.CreateObject("MSXML2.DOMDocument") xsl.async = false xsl.load(server.MapPath("somexsl.xsl")) Response.Write( xmlDom.transformNode(xsl) ) xmlDom.save( server.MapPath("accounting/somexml.xml") ) </code></pre> <p>Now, here is my new code thanks to thomask:</p> <pre><code>dim urlToXml urlToXml = "http://someserver/somesomeweb/nameofxml.xml" set http = CreateObject("MSXML2.ServerXMLHTTP.3.0") http.Open "GET", urlToXml, false http.Send() dim xmlDom set xmlDom = Server.CreateObject("MSXML2.DOMDocument") xmlDom.loadXML( http.responseXML.xml ) dim xsl set xsl = Server.CreateObject("MSXML2.DOMDocument") xsl.async = false xsl.load(server.MapPath("somexsl.xsl")) Response.Write( xmlDom.transformNode(xsl) ) xmlDom.save( server.MapPath("newxml.xml") ) </code></pre> <p>Again thank you very much thomask.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload