XMLPorts and XML Document Automation

bochincha
Member Posts: 4
My question is so simple.
I need to use a XML Document (declared as a Automation variable) with a XML Port created on the Classic Client.
I´ve been search in the forum and found some responses on how to load a XML Document but there is no responses in the other way.
I try this code (and some more) but doesn´t work:
TempBlob.Blob.CREATEINSTREAM(StreamIn);
XMLDoc.load(StreamIn);
// Llamada al XML Port
CLEAR(xmlImportacion);
xmlImportacion.SETSOURCE(StreamIn);
xmlImportacion.IMPORT;
Has anybody the same problem or it's easier than this.
I´m thinking that the only way its saving the XML Document to disk and then read it ...
So frustrated ](*,)
I need to use a XML Document (declared as a Automation variable) with a XML Port created on the Classic Client.
I´ve been search in the forum and found some responses on how to load a XML Document but there is no responses in the other way.
I try this code (and some more) but doesn´t work:
TempBlob.Blob.CREATEINSTREAM(StreamIn);
XMLDoc.load(StreamIn);
// Llamada al XML Port
CLEAR(xmlImportacion);
xmlImportacion.SETSOURCE(StreamIn);
xmlImportacion.IMPORT;
Has anybody the same problem or it's easier than this.
I´m thinking that the only way its saving the XML Document to disk and then read it ...
So frustrated ](*,)
0
Comments
-
What exactly are you trying to do? If you have your XML data in your MSXML DOMDocument automation variable, stream it out into a blob:CLEAR(TempBlob.Blob);
TempBlob.Blob.CREATEOUTSTREAM(Outstr);
XmlDoc.save(Outstr);
Now your blob keeps the XML data. Then stream into an instream:TempBlob.CALCFIELDS(Blob);
TempBlob.CREATEINSTREAM(Instr);
Then import it using the XMLport:CLEAR(XmlImport);
XmlImport.SETSOURCE(Instr);
XmlImport.IMPORT;
And it must work.(Co-)author of "Implementing Microsoft Dynamics NAV 2009"
http://vjeko.com/0 -
Thanks a lot. That´s exactly what I was looking for.
I tried with the same instructions but need something more.
Only one thing, you must modify your code because the highlighted line need a little modification.
CLEAR(TempBLOB.Blob);
TempBLOB.Blob.CREATEOUTSTREAM(Outstr);
XmlDoc.save(Outstr);
TempBLOB.CALCFIELDS(Blob);
TempBLOB.Blob.CREATEINSTREAM(Instr);
XMLPORT.IMPORT(NoXMLPort,Instr);
Thanks again0 -
Yes, you are right
Things happen when you are writing the code from head into here, not testing it in C/AL. But you got the point
(Co-)author of "Implementing Microsoft Dynamics NAV 2009"
http://vjeko.com/0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions