Navision Socket Bus Adapter: Setting Up Interfaces

The Navision Socket Bus Adapter comes with four interface properties that you can use to simplify the protocol implementation: CloseSendWhenWaitForReply, ReceivingTimeout, BytesToRead and HTTPHeaderReceive.

Note that you must set up properties in both your sending and your receiving bus adapter in order for the system to work properly. For an example of how to use the interface properties, see the Navision Socket Bus Adapter Scenario.

Receiving Interface

In the receiving bus adapter, in the RecevingTimeout property, you must set a large number, for example 20000. This tells the interface and MSDOM to wait no more than 20 seconds between TCP packets. For more information about TCP packets and windows, see Microsoft MSDN and third party documentation.

If there are more than 20 seconds between packets, the bus adapter will consider the transmission complete and start processing the information.

You must also check if the sending bus adapter expects a reply, and if so, then you must send an acknowledgement of receipt.

You can combine this with one of the following properties to force the interface to stop receiving and start processing:

Sending Interface

In the sending bus adapter, in the The IOutMessage Interface, use the SendWaitForReply method to indicate the number of milliseconds that the bus adapter should wait for an acknowledgement of receipt before timing out, and then set the CloseSendWhenWaitForReply property to Yes. This means that when the sending bus adapter has sent its message, it will close the socket for sending and concentrate on waiting for an actual reply to the sent message.

When the sending bus adapter closes its sending channel, the receiving interface will know that it cannot expect more information in this message , it will stop listening and start processing the information, provided that you set it up as described in the previous section.

Note that if you use a Simple Send, the connection will be closed anyway, so the CloseSendWhenWaitForReply property is irrelevant.

Note also that the ExpectReply property in the IInMessage interface for the Navision Socket Bus Adapter will always return TRUE.

More information:

Navision Socket Bus Adapter

Navision Socket Bus Adapter: Scenario

Code Example: Sending a Document

Code Example: Receiving a Document