IF NOT ISCLEAR(lautXmlHttp) THEN CLEAR(lautXmlHttp); CREATE(lautXmlHttp); IF NOT ISCLEAR(lautXmlDoc) THEN CLEAR(lautXmlDoc); CREATE(lautXmlDoc); lautXmlDoc.async := FALSE; lautXmlDoc.validateOnParse := FALSE; lautXmlDoc.setProperty('ProhibitDTD',FALSE); recTmpXml.INIT; recTmpXml."Entry No." := 0; recTmpXml.INSERT; recTmpXml.Xml.CREATEOUTSTREAM(outXmlStream); lxmlCustomer.SETDESTINATION(outXmlStream); lxmlCustomer.EXPORT; recTmpXml.MODIFY; recTmpXml.Xml.EXPORT('c:\blob.xml'); recTmpXml.CALCFIELDS(Xml); IF recTmpXml.Xml.HASVALUE THEN recTmpXml.Xml.CREATEINSTREAM(inXmlStream); lautXmlDoc.load(inXmlStream); //TEST lautXmlDoc.save('c:\Customer.xml');
Answers
lautXmlDoc Automation 'Microsoft XML, v6.0'.DOMDocument
lxmlCustomer XMLport Export Customer
lautXmlDoc.validateOnParse := FALSE;
lautXmlDoc.setProperty('ProhibitDTD',FALSE);
your code looks fine otherwise.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
But still empty file
Before
I get output, so the stream does contain data.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I guess al the necessary CALCFIELDS are present nonetheless, I added some more. But still got the same result.
Just tried it on a 5 SP1 SQL... same result
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Yep, and even without the calcfields there isn't a real problem because the blob.xml alwasys contains the right data.
The problem starts when I load the contents of the blob in a InStream and when I load that Instream in a XML doc.
Just to be sure if my xmldoc contains the right data, I save it to a file (debugging purpose).
The file customer.xml is created but it contains no data... at that point I'm quite sure that the rest of my code who will send the xml doc to a webservice
will not work either.
When I need to export XMLPort into xmldom,I am using this structure:
I am not doing insert, modify, calcfields etc. and it is working for me... :-k (lreTempBlob is temporary record over table 99008535)
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
This getting very strange...
This shows me the content of inStream and it contains my xml file... So no problem there.
Microsoft Business Solutions-Navision
This message is for C/AL programmers:
The call to member send failed. msxml6.dll returned the following message:
Een naam bevat een ongeldig teken. (The name contains an invalid character)
OK
Unless a blank file is considered as an invalid character...?
Maybe there's an invalid character in the xml that prevents lautXmlDoc.save('c:\Customer.xml');
Just guessing...
There we're spaces in the element names of the exported xml... #-o #-o #-o