MSXML2_IXMLDOMElement / MSXML2_IXMLDOMNode: Function argument does not match declared data type

Discussion forum about all things Team Developer 5.x and 6.x
chelonet
Argentina
Posts: 79
Joined: 19 Apr 2017, 15:28
Location: Argentina

MSXML2_IXMLDOMElement / MSXML2_IXMLDOMNode: Function argument does not match declared data type

Post by chelonet » 31 Dec 2020, 15:28

The problem occurs with the use of: msxml / Microsoft XML, v6.0 / comws / XMLReadFile and the classes MSXML2_IXMLDOMElement / MSXML2_IXMLDOMNode

For consume REST/JSON in TD 6.1, I try to use https://wiki.tdcommunity.net/index.php/ ... ft_XMLHTTP from Dave Rabelink
This uses "Microsoft XML, v6.0.apl" generated with the ActiveX Wizard

At the same time, I have been using a lot:
msxml.apl, comws.apl from Lubos Vnuk, and the function XMLReadFile from https://samples.tdcommunity.net/index.p ... ample2.zip


If I include "msxml.apl" and "Microsoft XML, v6.0.apl" at the same time it generates many errors due to duplicate classes.
So take "msxml.apl" and comment all the classes already included in "Microsoft XML, v6.0.apl" (assuming the same behavior in both).
I called this "msxml_coment.apl"

And now the problem arises for which I need help: XMLReadFile and comws generate data type conflict.
The conflict apparently would be due to differences between "msxml.apl" and "Microsoft XML, v6.0.apl" in:
Functional Class: MSXML2_IXMLDOMElement
Functional Class: MSXML2_IXMLDOMNode

Then it gives error
MSXML2_DOMDocument: selectSingleNode (parameter MSXML2_IXMLDOMElement)
MSXML2_IXMLDOMElement: appendChild (MSXML2_IXMLDOMElement: cSubElement)
MSXML2_IXMLDOMNodeList: PropGetitem
and some others

How should I do so that it does not error, and everything that I was using continues to work, and also the "Microsoft XML, v6.0.apl" library (without renaming the classes)

Attached the use case.

Thanks !!!
You do not have the required permissions to view the files attached to this post.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3388
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: MSXML2_IXMLDOMElement / MSXML2_IXMLDOMNode: Function argument does not match declared data type

Post by Dave Rabelink » 04 Jan 2021, 06:42

The "old" Lubos Vnuk sample uses manual changes to the XML library to get the sample working.
For example, the class MSXML2_IXMLDOMDocument2 is derived from MSXML2_IXMLDOMNode.
And the class MSXML2_IXMLDOMElement is derived from MSXML2_IXMLDOMNode.

I recommend not to mix the Vnuk library and the newly generated Microsoft XML, v6.0.apl.
Use the Microsoft XML, v6.0.apl and adapt the sample to only use the classes from that library.

The function selectSingleNode needs as second parameter a MSXML2_IXMLDOMNode object and not a MSXML2_IXMLDOMElement object.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

chelonet
Argentina
Posts: 79
Joined: 19 Apr 2017, 15:28
Location: Argentina

Re: MSXML2_IXMLDOMElement / MSXML2_IXMLDOMNode: Function argument does not match declared data type

Post by chelonet » 04 Jan 2021, 18:45

Hi Dave,
Now I understand.
I really appreciate your answer.

Thanks !!!

landaware
Italy
Posts: 31
Joined: 30 Jul 2017, 18:27
Location: Italy

Re: MSXML2_IXMLDOMElement / MSXML2_IXMLDOMNode: Function argument does not match declared data type

Post by landaware » 09 Apr 2022, 00:56

hello,

Can you shared an example how to serialize/deserialize the response?

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 0 guests