Hi,
using Navision 4.0 (SP3) I'm trying to use a XML Port to directly export data to an Bus Adapter.
I use the following code:
IF ISCLEAR(ComCom) THEN
CREATE(ComCom);
IF ISCLEAR(SocketBusAdapter) THEN
CREATE(SocketBusAdapter);
ComCom.AddBusAdapter(SocketBusAdapter,0);
OutMsg := ComCom.CreateoutMessage('Sockets://localhost:7000');
OutStreamVar := OutMsg.GetStream;
XMLPORT.EXPORT(50000, OutStreamVar);
OutMsg.Send(0);
ComCom: Automation 'Navision Communication Component version 2'.CommunicationComponent
SocketBusAdapter: Automation 'Navision Socket Bus Adapter'.SocketBusAdapter
OutMsg: Automation 'Navision Communication Component version 2'.OutMessage
OutStreamVar: Outstram
When running the code, the Navision Client crashes and is closed.
I'm quite an new to XMLports and Com, so what is the problem with my code?
A receiving Socket exists. Sending a simple Text using
Outstream.write('Hello World')
is working.
Regards,
Rolf
Comments
I used quite similar code but with MSMQ to export some navi data.
The only (maybe important) difference I see is:
instead of:
I use:
where rec is a record variable xmlport runs on.
Hope it helps,
I tried it with specifing a record variable, but the Nav Client still crashes.
Thanks anyway,
Rolf
I currently just testing, and both "tasks" run on the same machine, using two instances of a navision client.
(Viel Glück!)
do you run the two instances of the client from the same directory ? If so, they are sharing DLLs, try to run them from separate directories.
MCP+I, MCSE NT, Navision MCT (2004,2005)
i had the same problem. But now I have the solution. When you set the property "Encoding" from the XMLPort to UTF-8 then it works.
It think the Navision Application Server only knew this standard.
I hope i could help you.