XMLPORT

I am trying to import and export data using xmlports. I can only get the port to import or export one record. Below is an example of the style sheet I get when I export:

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>

-

-

153015

3858382-01

MR-02938922

I am assuming the port will automatically pick up all of the entries in the table. Here is the code I am using to call the xmlport:

ExportFile.CREATE(‘c:\testoutput.xml’);
ExportFile.CREATEOUTSTREAM(OStream);
XMLPORT.EXPORT(50004,OStream);
ExportFile.CLOSE;

Any help would be appreciated. Thanks!

Hi,

It’s quite some time ago since you posted this question, but your post still stand as open. Have you found an answer or solved your problem?

If yes, then I would hope that you would share the solution with the rest of the user group as I think many members would get value from the answer, so that we can close the topic and mark it as Answered.

If no, then maybe you can add a bit more information to the question, so that other members maybe are able to answer your question.

Thank you.

Hi, I´dont know if you found an anwwer for this question, but I found it.

The xmlport need an element that envelope all nodes (in my case is the result node) It worked for me.

I has this xmlport:

My ws codeunit:

customer.RESET;
customer.SETRANGE(County,county);

IF (postcode <> ‘’) THEN customer.SETRANGE(“Post Code”,postcode);
IF (“no.” <> ‘’) THEN customer.SETRANGE(“No.”,“no.”);
IF customer.FINDSET THEN BEGIN
file.CREATE(‘c:\customerlist.xml’);
file.CREATEOUTSTREAM(outStream);

XMLPORT.EXPORT(XMLPORT::MyXMLPort,outStream,customer);
END;

My ws definition:

My main caller (other nav client)

method := ‘GetCustomer’;
namespace := ‘urn:microsoft-dynamics-schemas/codeunit/DemoCU’;
parameters := ‘Valencia’;
returnTag := ‘GetCustomer_Result’;
URL := ‘http://localhost:7047/DynamicsNAV/WS/CRONUS/Codeunit/DemoCU’;
InvokeNavWS(URL,method,namespace,returnTag,parameters,DOMNodelist,xmldoc)

My xml generated:

in my xmlport ,the first element is text type ,but the xmlport is only can export on record.

does any one has the answer for this question, can you post it here?