so i have following problem and really dont know why it’s not working:
I create an automation in NAV 2013. For that, i use following code:
CREATE(HTTPRequest,FALSE,TRUE);
The HTTPRequest is a variable of DataType Automation and SubType 'Microsoft XML, v6.0'.ServerXMLHTTP60
I can save and compile the codeunit, in which the automation is in it. So far so good.
But as soon as i want to try a connection test to our web servers, he tells me this:
It is not possible to convert Microsoft.Dynamics.Nav.Runtime.NavAutomation to Microsoft.Dynamics.Nav.Runtime.NavInStream.
The debugger stops at following line of code:
InStreamResponse := HTTPRequest.responseStream;
InStreamResponse is DataType InStream.
So if I look in the HTTPRequest.responseStream variable, it looks like this: New Project I think the problem is, that the HTTPRequest variable is valued with “Automation” and so the ResponseText tells me its not available in the current context. When i look into another project of our company, the exact same HTTPRequest is valued as following:
Does anyone of you know why this is? As i said, i think its because the HTTPRequest isn’t valued with
'Microsoft XML, v6.0'.ServerXMLHTTP60
like in the working project. But why is this? I cant explain. Is there a fix which i need or did i forget something?
The only difference is, that on the current working code (2. screenshot) the HTTPRequest is created as following:
CREATE(HTTPRequest);
Whereas on my new project it needs to be declared as
CREATE(HTTPRequest,FALSE,TRUE);
Otherwise i cant complie the codeunit.