Export some data from XMLPort to a bigtext issue

anomiris
Member Posts: 5
Hi Mibuso!
This is my first post in this forum
I have a simple issue, but is not working... maybe you may help...
I'm trying to export some data from XMLPort to a bigtext.
These are my vars and code:
Name DataType Subtype Length
XMLInfoStoc XMLport 50042
tempBlob Record TempBlob
outFile OutStream
Instr InStream
TestText Text 1024
CLEAR(tempBlob);
CLEAR(outXML);
tempBlob.DELETEALL;
tempBlob."Primay Key" := 1;
tempBlob.INSERT;
tempBlob.Blob.CREATEOUTSTREAM(outFile);
XMLInfoStoc.SETTABLEVIEW(Item);
XMLInfoStoc.SETDESTINATION(outFile);
XMLInfoStoc.EXPORT;
tempBlob.MODIFY;
tempBlob.CALCFIELDS(Blob);
IF tempBlob.Blob.HASVALUE THEN BEGIN
tempBlob.Blob.CREATEINSTREAM(Instr);
outXML.READ(Instr);
MESSAGE('Length= %1',FORMAT(outXML.LENGTH)); //the length of outXml is 582
outXML.GETSUBTEXT(TestText, 1, 1024) ; //outXml contains only characters ".<"
MESSAGE(TestText);
tempBlob.Blob.EXPORT('E:\simona\InfoStocOUTXML_cip2.xml') //the exporte file is ok, contains all required data in XML format
END;
WHY the OutXml is not containing all the data in Instr, as it is exported by tempBlob.Blob.EXPORT?????
It seems that the line outXML.READ(Instr) is not working properly, because the OutXml contains only ".<" instead of entire Instr...
Any idea, something missing??
I already compared with some exemples and seems that my code is ok... but is not...
Thank you in advance!
Simona
This is my first post in this forum

I have a simple issue, but is not working... maybe you may help...
I'm trying to export some data from XMLPort to a bigtext.
These are my vars and code:
Name DataType Subtype Length
XMLInfoStoc XMLport 50042
tempBlob Record TempBlob
outFile OutStream
Instr InStream
TestText Text 1024
CLEAR(tempBlob);
CLEAR(outXML);
tempBlob.DELETEALL;
tempBlob."Primay Key" := 1;
tempBlob.INSERT;
tempBlob.Blob.CREATEOUTSTREAM(outFile);
XMLInfoStoc.SETTABLEVIEW(Item);
XMLInfoStoc.SETDESTINATION(outFile);
XMLInfoStoc.EXPORT;
tempBlob.MODIFY;
tempBlob.CALCFIELDS(Blob);
IF tempBlob.Blob.HASVALUE THEN BEGIN
tempBlob.Blob.CREATEINSTREAM(Instr);
outXML.READ(Instr);
MESSAGE('Length= %1',FORMAT(outXML.LENGTH)); //the length of outXml is 582
outXML.GETSUBTEXT(TestText, 1, 1024) ; //outXml contains only characters ".<"
MESSAGE(TestText);
tempBlob.Blob.EXPORT('E:\simona\InfoStocOUTXML_cip2.xml') //the exporte file is ok, contains all required data in XML format
END;
WHY the OutXml is not containing all the data in Instr, as it is exported by tempBlob.Blob.EXPORT?????
It seems that the line outXML.READ(Instr) is not working properly, because the OutXml contains only ".<" instead of entire Instr...
Any idea, something missing??
I already compared with some exemples and seems that my code is ok... but is not...
Thank you in advance!
Simona
1
Best Answer
-
Hi,
I found the "big" issue...
My xml port was exporting with encoding UTF-16, instead of UTF-8.
Now, with UTF-8 it's ok.
Bye5
Answers
-
Hi,
I found the "big" issue...
My xml port was exporting with encoding UTF-16, instead of UTF-8.
Now, with UTF-8 it's ok.
Bye5
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