Communication over NSCOMCOM2lib

deV.chdeV.ch Member Posts: 543
Hi there

I have a problem communicating with NAV and the NSCOMCOM2lib.
Long time ago we built a webservice (asp page with vbscript) that worked well but now we want to move on with an .net solution.
I rewrote all the code in c# on an asp.net page. but now i have a problem.

Originaly (in VB) we could send a xmldocument over the connection very easy like this:
sendDOM.Save OutMsg.GetStream()

but now in .net it's not that easy.
OutMsg.GetStream() returns an object from the type: NSCOMCOM2Lib.IStream
System.XmlDocument.Save() accepts only an .Net Stream Object. so there is the problem....

how can i save my xmldoc in that stream of the NSCOMCOM2Lib?

code before sending the xmldoc:
CommunicationComponentClass ComCom = new CommunicationComponentClass();
            SocketBusAdapterClass SBA = new SocketBusAdapterClass();
            SBA.ReceivingTimeout = 20000;

            IInMessage InMsg;
            IOutMessage OutMsg;

            ComCom.AddBusAdapter(SBA, 0);
            OutMsg = ComCom.CreateoutMessage("Sockets://" + ServKonf.getActNASHostAndPort()) as IOutMessage;                
            NSCOMCOM2Lib.IStream OutStream = OutMsg.GetStream();

NAV Version: 4.0

Comments

Sign In or Register to comment.