I'm connecting my NAV to a webService, it's not my frist time, but it's the first time that the received XML file as namespaces. This is how the XML to read look like:
I need to read the "faultstring" node.
I've tried to read it with the tipical "FindNodeText" function, but of course, the namespace provokes an error. So, as I've read in some articles, I am using the NamesPace manager, like this:
XMLDocDotNet := XMLDocDotNet.XmlDocument;
IF ISCLEAR(XMLHTTP) THEN
XMLHTTP.setRequestHeader('Content-Type: ', 'application/x-www-form-urlencoded');
XMLText := XMLDocDotNet.OuterXml;
IF ISCLEAR(locautXmlDoc) THEN
response := XMLHTTP.responseText;
errorCode := FindNodeText(locautXmlDocNet,'@soap-ENV:Body/@soap-ENV:Fault/faultstring');
And here, I get this error:
"An instance of the dotnet variable hasn't been created. Trying to call to system.... "
I know this could be a problem with the DotNet variable. I've changed "RunOnClient" property to YES, but same error. IS there a better way to read this XML? may be an XMLPort? Or am I doing something wrong?
Thank you very much
Somehow I got the Error Message but I will be happy it could be in English?
Check out this -
Thanks for your answer. This is the error:
I've also found your link with your code, but I'm not really sure I've understoood it....
Maybe this small function will help you out:
Thanks, I'll work on it!!
Thank you both for your tips. I'm working in both solutions, and I found problems.
RockWithNAV, which are the parameters that the procedure receive? I n the load function, I have to write all the tags with namespace? The operning and closing ones?
thoregilwedin. Thank you also for your function. I'm trying to adapt it to my development, but I'm finding a lots of problems with the object types and their methods. At least I've got and idea of how are you focusing the development.
Again thank you both, any hint will be welcome
Thank you both. I've solved the problem with the "GetElementsByTagName" function. I don't know if it will work for all the processes, but at least I am advancing on my development.