Error using NAS: The data necessary to complete this operati
DRB
Member Posts: 105
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.
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.
-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal
0
Answers
-
At First it sounds like the automation server (XMLHTTP60) is not in the right version on the server where the NAS is running. The "responseStream" is first mentionened in the last line, right? So the other members of oXML all seem to work.
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?0 -
Dirk.Fischer wrote:At First it sounds like the automation server (XMLHTTP60) is not in the right version on the server where the NAS is running. The "responseStream" is first mentionened in the last line, right? So the other members of oXML all seem to work.
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.-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal0 -
Try to use
oXML.open('POST', URL, FALSE);insteadoXML.open('POST', URL, TRUE);
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.0 -
Thanks Kamil, that solved the issuekine wrote:Try to useoXML.open('POST', URL, FALSE);insteadoXML.open('POST', URL, TRUE);-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal0 -
btw, how do we change the status of post/ question to solved on mibuso?
Can the mods please do this and let me know for future?-Dhan Raj Bansal
Linkedin Profile: http://in.linkedin.com/in/dhanrajbansal0 -
You need to edit the first post and add the "Solved" flag. It was already described when the new forum version was started. Just look at edit page of the first post... (green check mark)DRB wrote:btw, how do we change the status of post/ question to solved on mibuso?
Can the mods please do this and let me know for future?0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
