<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi Rainer:</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks for your response. I appreciate it.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Before I got your replies, I experimented with an alternate approach: 1) in a first step, I download the XML files to disk. I then use the regular WPKG.js code to parse the files and continue processing. You can see the code further below.</div>

<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">This approach seems to work well and the XML files are correctly written to disk and then parsed even when WPKG.js is running as Localsystem. However, for some reason WPKG.js exits with no errors and fails to write the log file.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"> </div>
<div style><div style><font face="arial, sans-serif">for( var i=0; i < filePaths.length; i++) {</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">                </span>var filePath = filePaths[i];</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>dinfo("Reading XML file: " + filePath);</font></div><div style><span class="" style="white-space:pre"><font face="arial, sans-serif">                </font></span></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>var xmlHttpReq = new ActiveXObject("MSXML2.XMLHTTP");</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">          </span>xmlHttpReq.open("GET", "<a href="https://someurl/xml_out/profiles">https://someurl/xml_out/profiles</a>", false);</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>xmlHttpReq.send();</font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">            </span>//WScript.Echo("XSLT :" + xmlHttpReq.responseText);</font></div>
<div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">            </span>var fso, tf;</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">     </span>    fso = new ActiveXObject("Scripting.FileSystemObject");</font></div>
<div style><font face="arial, sans-serif">        tf = fso.CreateTextFile("c:\\programdata\\bizappcenter\\temp.xml", true);</font></div><div style><font face="arial, sans-serif">        tf.Write(xmlHttpReq.responseText);</font></div>
<div style><font face="arial, sans-serif">        tf.Close();</font></div><div style><span class="" style="white-space:pre"><font face="arial, sans-serif">               </font></span></div><div style><font face="arial, sans-serif"><br>
</font></div><div style><span class="" style="white-space:pre"><font face="arial, sans-serif">              </font></span></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">         </span>// Read XML file from file system.</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>var xsl = new ActiveXObject("Msxml2.DOMDocument.3.0");</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">         </span>xsl.async = false;</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>xsl.validateOnParse = false;</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">             </span>/*</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>var str = "<?xml version=\"1.0\"?>\r\n";</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>str += "<xsl:stylesheet xmlns:xsl=\"<a href="http://www.w3.org/1999/XSL/Transform\">http://www.w3.org/1999/XSL/Transform\</a>" xmlns:wpkg=\"" + xmlNamespace + "\" version=\"1.0\">\r\n";</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>str += "    <xsl:output encoding=\"utf-8\" indent=\"yes\" method=\"xml\" version=\"1.0\"/>\r\n";</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>str += "    <xsl:template match=\"/\">\r\n";</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">         </span>str += "        <" + "wpkg:" + rootNodeName + ">\r\n";</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>str += "            <xsl:copy-of select=\"document('" +</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">                                                              </span>filePath +</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">                                                               </span>"')/wpkg:" + rootNodeName + "/child::*\"/>\r\n";</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">         </span>str += "            <xsl:copy-of select=\"document('" +</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">                                                               </span>filePath +</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">                                                               </span>"')/" + rootNodeName + "/child::*\"/>\r\n";</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>str += "        </" + "wpkg:" + rootNodeName + ">\r\n";</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">          </span>str += "    </xsl:template>\r\n";</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>str += "</xsl:stylesheet>\r\n";</font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>xsl.loadXML(str);</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>*/</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>xsl.load("c:\\programdata\\bizappcenter\\temp.xml");</font></div>
<div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>WScript.Echo("XSLT :" + xsl.xml)</font></div><div style><font face="arial, sans-serif"><span class="" style="white-space:pre">               </span>dinfo("XSLT: " + xsl.xml);</font></div>
</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 29, 2014 at 11:55 PM, Rainer Meier <span dir="ltr"><<a href="mailto:r.meier@wpkg.org" target="_blank">r.meier@wpkg.org</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Antony<div><br>
<br>
On 30.07.2014 00:51, Antony Awaida wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
I have identified the problem to be in the following piece of WPKG.js code. So I<br>
created the following script:<br>
<br>
var xsl = new ActiveXObject("Msxml2.<u></u>DOMDocument.3.0");<br>
xsl.async = false;<br>
xsl.validateOnParse = false;<br>
xsl.load(filePath);<br>
                 dinfo("XSLT: " + xsl.xml);<br>
<br>
As expected the above script returns an empty xsl.xml when run as LocalSystem.<br>
However, when I changed the Msxml2.DOMDocument.3.0 to Msxml2.DOMDocument.6.0,<br>
WPKG does not seem to run.<br>
</blockquote>
<br></div>
The code uses Microsoft XML framework objects. If you face issues with the objects you might try installing latest updates of Microsoft XML Framework.<br>
Though usually the problem is within authentication on network shares and different handling of SYSTEM account regarding network authentication which is out of scope for WPKG core development.<br>
<br>
I am usually running WPKG using WPKG client which also runs as system account but does also take care about proper network share credential setup.<br>
<br>
You might try two work-arounds:<br>
<br>
1. Create service user rather than running WPKG service as SYSTEM account.<br>
<br>
2. Instead of launching wpkg.js/cscript.exe directly as a SYSTEM service wrap it within a cmd.exe script which handles network authentication and credential setup (net use). The script should verify whether files on share are properly readable before invoking wpkg.js.<br>


<br>
<br>
Almost certainly your local SYSTEM account faces access denied on the network share when connecting to your share. Although this is a guess since you neither provide logs nor details on your setup (client type, patch level, how credential setup is done, server type, patch level, connection logs and traces...).<br>


<br>
<br>
br,<br>
Rainer<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Antony Awaida<div>CEO</div><div>Apporto (Previously BizAppCenter)</div><div>Cell <a href="tel:415%20999%204547" value="+14159994547" target="_blank">415 999 4547</a> </div>
</div>
</div></div>