I need to convert an XML document to a BigText in NAV2009SP1,
so I don’t have any .NET Interop.
First I made this simple function:
CLEAR(p_BigText);
p_BigText.ADDTEXT(p_XMLdoc.xml);
This works perfect at both the ServiceTier and in the Classic Client, except the Classic Client only support small xml-files. Once the xml-file is bigger than 1024 bytes it fails. It always works on the Service Tier.
I then re-wrote the function to use a blob and streams like this:
CLEAR(p_BigText);
l_TempBlob.Blob.CREATEOUTSTREAM(l_outstream);
p_XMLdoc.save(l_outstream);
l_TempBlob.Blob.CREATEINSTREAM(l_instream);
p_BigText.READ(l_instream);
It basically works, but now the encoding is incorrect :-(
I have looked through numerous blog articles and Mibuso topics about encoding without finding a solution.
Anyone?