My code is:Break On Error Message:
Unable to convert from Microsoft.Dynamics.Nav.Runtime.NavDotNet to Microsoft.Dynamics.Nav.Runtime.NavOutStream.
xmlResponse := xmlResponse.XmlDocument(); MyAddon.GetXml(xmlResponse); // xmlResponse is "out XmlDocument" // xmlResponse.Save('C:\..\someFile.xml'); // this working MemoryStream := MemoryStream.MemoryStream(); xmlResponse.Save(MemoryStream); COPYSTREAM(MemoryStream, InStream); // this not working, error message above MyXmlPort.SETSOURCE(InStream); MyXmlPort.IMPORT;I try convert MemoryStream to OutStream with blob, but without success.
TempBLOB.INIT; TempBLOB.Blob.CREATEOUTSTREAM(OutStream); //MemoryStream.Flush(); //MemoryStream.Position := 0; MemoryStream.CopyTo(OutStream); // I try also .WriteTo(..) -> both case make error COPYSTREAM(OutStream, InStream);
Comments
I assume this is NAV 2013 R2, as you did not say what NAV version it is.
If this is the case take a look at the XMLport 9170 "Profile Import/Export". If that does not help take a look at this code example for FTP that uses streams
http://www.mibuso.com/forum/viewtopic.php?f=7&t=58425&hilit=FTP
I hope this helps.
Thanks.