XMLPort export problem

marvinq
Member Posts: 69
Hi experts,
I am having a problem handling a XMLPort published as a Webservice via a Codeunit. Actually it works just fine, but I want to "log" the input XML but it doesn't work 100% correctly if there is an unbound element in the XMLPort. If there is an unbound element only the last occurrence is saved in the "log" file.
Code is quite simple...
Variables:
XMLOutputFile File
OStream OutStream
ImportXML(VAR XMLImport : XMLport XMLImport)
XMLImport.IMPORT();
XMLOutputFile.CREATE('c:\temp\output.xml');
XMLOutputFile.CREATEOUTSTREAM(OStream);
XMLImport.SETDESTINATION(OStream);
XMLImport.EXPORT();
Also see attached screendumps:
All elements in XMLPort are set to "MinOccurs=Once" and "MaxOccurs=Once" except the element "Item" which has "MaxOccurs=Unbounded", so that OrderLines is a set of "Item" elements and exactly one "Freight" element.
I created objects as mentioned above and exposed Codeunit 90000 via page 810 as servicename "XMLImport". Then I called Webservice from a Visual Studio console application. Please see: "WS_TestApplication.PNG".
In my Visual Studio input example there is clearly 3 items, and when running code all 3 items are received and handled within NAV. However when saving to file "output.xml" it only shows the last item. See attached: "output_xml.PNG"
Everything works fine except when there are more items in the input XML (unbound size).
Really hope anyone has an idea of how to fix this issue so I can see all items in output.xml. I've been struggling with this for a while now. Currently i am stuck.
Thanks!
I am having a problem handling a XMLPort published as a Webservice via a Codeunit. Actually it works just fine, but I want to "log" the input XML but it doesn't work 100% correctly if there is an unbound element in the XMLPort. If there is an unbound element only the last occurrence is saved in the "log" file.
Code is quite simple...
Variables:
XMLOutputFile File
OStream OutStream
ImportXML(VAR XMLImport : XMLport XMLImport)
XMLImport.IMPORT();
XMLOutputFile.CREATE('c:\temp\output.xml');
XMLOutputFile.CREATEOUTSTREAM(OStream);
XMLImport.SETDESTINATION(OStream);
XMLImport.EXPORT();
Also see attached screendumps:
- Codeunit ("Codeunit_90000.PNG").
- XMLPort ("XMLPort_90000.PNG").
- XMLPort properties ("XMLPort_90000_Properties.PNG").
All elements in XMLPort are set to "MinOccurs=Once" and "MaxOccurs=Once" except the element "Item" which has "MaxOccurs=Unbounded", so that OrderLines is a set of "Item" elements and exactly one "Freight" element.
I created objects as mentioned above and exposed Codeunit 90000 via page 810 as servicename "XMLImport". Then I called Webservice from a Visual Studio console application. Please see: "WS_TestApplication.PNG".
In my Visual Studio input example there is clearly 3 items, and when running code all 3 items are received and handled within NAV. However when saving to file "output.xml" it only shows the last item. See attached: "output_xml.PNG"
Everything works fine except when there are more items in the input XML (unbound size).
Really hope anyone has an idea of how to fix this issue so I can see all items in output.xml. I've been struggling with this for a while now. Currently i am stuck.
Thanks!
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