NAV Save XMLPort from websevice to BLOB

varankamvarankam Member Posts: 8
edited 2015-01-13 in NAV Three Tier
I need to store information from xmlport that I got as a parameter of published function to blob field and use in later to do import. is it possible?

Comments

  • krikikriki Member, Moderator Posts: 9,112
    Yes,

    Something like this:

    CreateWebServiceODataTestText(TheXML : Text) Otxt : Text // this is the function that receives the XML as a text

    CLEARLASTERROR;

    // write the text to a BLOB
    Object."BLOB Reference".CREATEOUTSTREAM(TheOutStream);
    TheOutStream.WRITETEXT(TheXML);


    // Read the BLOB using an XML-port
    Object."BLOB Reference".CREATEINSTREAM(TheInStream);

    WebServiceODataTestXMLPort.SETSOURCE(TheInStream);

    IF NOT WebServiceODataTestXMLPort.IMPORT THEN BEGIN
    ERROR(GETLASTERRORTEXT);
    END;
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


Sign In or Register to comment.