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.
0
Answers
The second possibility I see is, that there is really no response stream reaching the server. Is the response of the xml request addressed correctly?
Did you try debugging the NAS and for example moving the response stream to a variable where you can look at it?
I am using NAS and manual part both on the same machine. The above code is a function, which is part of full code, while running the codeunit from object designer, it is sending and getting the proper response, whereas If I use Job Queue and NAS it gives error.
I tried using NASHandler function in a codeunit and then also it is running properly.
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
It will call the send in synchronous mode, not asynchronous, thus you do not need to check the state etc. The send will end after the sending will finish etc. It could help you.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
Can the mods please do this and let me know for future?
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.