Interface IFinCommService

Namespace
Subsembly.FinTS
Assembly
Subsembly.FinTS.Core.dll

Interface to an implementation of a transport facility that can be used to send and receive FinTS client messages.

public interface IFinCommService

Remarks

In addition to implementing this interface, all transport implementations must have an argumentless default constructor. This default constructor will be used when creating a transport class from its name stored in some configuration file.

Properties

CommAddress

Provides the communication address that was used to establish the connection.

string CommAddress { get; }

Property Value

string

Remarks

This is the same address that appears in the HIKOM segment. The HIKOM segment restricts this address to 512 characters.

This property is set whenever Connect(string, string, IFinFilter) was successfully called and is never cleared. Thus, it always holds the most recent communication address that was used.

CommAddressSuffix

Provides the communication address suffix that was used to establish the connection.

string CommAddressSuffix { get; }

Property Value

string

Remarks

This is the same address that appears in the HIKOM segment. The HIKOM segment restricts this address to 512 characters.

This property is set whenever Connect(string, string, IFinFilter) was successfully called and is never cleared. Thus, it always holds the most recent communication address suffix that was used.

A null value and am empty string are both considered as an unused communication address suffix

State

Provides the current state of this transport instance.

FinCommServiceState State { get; }

Property Value

FinCommServiceState

Methods

Connect(string, string, IFinFilter)

Establishes a connection to the given communications address

void Connect(string sCommAddress, string sCommAddressSuffix, IFinFilter aFilter)

Parameters

sCommAddress string

The communications address to connect to. This must not be null. The actual implementation of this interface defines the requirements for this string.

sCommAddressSuffix string

The communications address suffix to connect to. This may be null or an empty string if a communications address suffix is not used. The actual implementation of this interface defines the requirements for this string.

aFilter IFinFilter

Optional implementation of a filter function that shall be applied when sending and receiving data. If this is null, then no filter function shall be applied and the message data shall be sent and received as it is.

Exceptions

InvalidOperationException

Thrown if this transport instance is currently in the Connected state. This exception is not thrown if this transport instance is currently in the Error state.

FinCommServiceException

Any of the defined transport exceptions may be thrown by this function.

Disconnect()

Disconnects a previously established connection.

void Disconnect()

Remarks

If this transport instance was already disconnected by a call to Disconnect(), then this method shall do nothing. If this transport instance is currently in the Error state, that condition shall be cleared and the transport instance shall return into the Disconnected state.

SendReceive(FinDialog, FinMessageBuffer)

Sends a FinTS request message and receives the response message in a single transaction.

FinMessageBuffer SendReceive(FinDialog aDialog, FinMessageBuffer aReqBuf)

Parameters

aDialog FinDialog

The FinDialog instance that wants to send the message. This must not be null.

aReqBuf FinMessageBuffer

FinMessageBuffer instance that contains the complete FinTS request message that shall be sent.

Returns

FinMessageBuffer

Returns the complete response message inside a new FinMessageBuffer instance.

Exceptions

InvalidOperationException

Thrown if this transport instance was orderly disconnected by a call to Disconnect() and is currently in the Disconnected state.

FinParseException

Completely malformed response that could not be filled into the FinMessageBuffer instance.

FinCommServiceException

If this transport instance is currently in the Error state, then an immediate FinCommServiceException is thrown without any attempt to send anything.

Any of the defined transport exceptions may be thrown for other reasons.