Error while using NAS: The data necessary to complete this operation is not yet available.

Error while using NAS:
I am getting following error while running the code using NAS (Navision Application Server), whereas the code is working fine when run from the codeunit manually (without scheduling using NAS):
This message is for C/AL programmers:The call to member responseStream failed. msxml6.dll returned the following message: The data necessary to complete this operation is not yet available.
Following is the code:
CREATE(oXML);
CREATE(pDOM);
oXML.open(‘POST’, URL, TRUE);
oXML.setRequestHeader(‘User-Agent’, “User Agent”);
oXML.setRequestHeader(‘Content-Type’, ‘text/xml’);
oXML.setRequestHeader(‘Protocol’, ‘HTTP/1.1’);
oXML.send(pDOM.xml);
WHILE (oXML.readyState() <> 4) AND (x < 600) DO
BEGIN
Do some simple processing//
END;
pDOM.load(oXML.responseStream);

Var Name DataType Subtype Length
Yes pDOM Automation ‘Microsoft XML, v6.0’.DOMDocument60
oXML Automation ‘Microsoft XML, v6.0’.XMLHTTP60

Please suggest.