Class FinXmlOrderBuilder
Builds FinXmlOrder instances from XML order data and provides bank parameter data in XML format.
Inheritance
Inherited Members
Namespace: Subsembly.FinTS
Assembly: Subsembly.FinTS.Core.dll
Syntax
public class FinXmlOrderBuilder
Remarks
The FinXmlOrderBuilder provides the hub for working with orders, response data and parameter data in XML format. When creating an instance of the FinXmlOrderBuilder class, one must supply an instance of the FinTransmogrifierRepository class. The supplied Transmogrifier repository must contain the segment syntax of all order, response and parameter segments that shall be supported by the new FinXmlOrderBuilder instance.
According to FinTS 4.0 the name of the XML tag of an order must be constructed
according to the pattern NameVersion_Req
, the name of the
XML tag of the corresponding response XML must be
NameVersionReq
, and the name of the XML tag of the parameter
XML must be NameVersion_Par
. Within the context of the FinTS
Subsembly, the Name part of this tag name is called the Order Tag and
the complete tag name is called the Segment Tag. Furthermore, the Version
part of the tag name is assumed to be equal to the version number of the transmogrified
segment.
The XML syntax description required to transmogrify the HIBPA segment is already hard coded in this class and thus must not be supplied by the client application.
Constructors
FinXmlOrderBuilder(FinContact, FinTransmogrifierRepository)
Creates an XML order builder for a particular contact using the given Transmogrifier repository.
Declaration
public FinXmlOrderBuilder(FinContact aContact, FinTransmogrifierRepository aTransmogrifierRepository)
Parameters
Type | Name | Description |
---|---|---|
FinContact | aContact | Contact data of a fully initialised and synchronised contact for which to create the FinXmlOrderBuilder instance. Must not be null. |
FinTransmogrifierRepository | aTransmogrifierRepository | Instance of FinTransmogrifierRepository that contains the syntax descriptions of all types of order segments, response segments and parameter segments that will be used together with the constructed FinXmlOrderBuilder instance. Must not be null. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | A parameter was |
Properties
BankParamDataXml
Provides the Bank Parameter Data (BPD) in transmogrified XML format.
Declaration
public XmlDocument BankParamDataXml { get; }
Property Value
Type | Description |
---|---|
System.Xml.XmlDocument | The provided XML document contains a <BankParamData> root node. Below this root there are the transmogrified BPD segments, starting with the <GenericBankParam> (HIBPA) segment. Only those BPD segments are transmogrified, where an appropriate transmogrifier syntax is found in the FinTransmogrifierRepository which was passed to the constructor of this instance. All other BPD segments are simply ignored. |
Methods
Build(XmlElement)
Builds a FinXmlOrder from the given XML order data.
Declaration
public FinXmlOrder Build(XmlElement xmlOrder)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlOrder | The XML order data. The syntax of this XML order data must be defined in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrderBuilder. |
Returns
Type | Description |
---|---|
FinXmlOrder | New FinXmlOrder instance. |
Remarks
The root tag of the xmlOrder passed to this method may be a complete Segment
Tag (e.g. SingRemitt_5_Req
), or just the base Order Tag (e.g.
SingRemitt
).
In the former case, the exact Segment Tag is used to look up
the appropriate FinTransmogrifier in the
FinTransmogrifierRepository that was given to the constructor of
this FinXmlOrderBuilder. If it doesn't exist, then an exception is thrown.
For processing any response segments, the _Req
ending is replaced with
_Resp
and a matching FinTransmogrifier is sought in the
FinTransmogrifierRepository. Therefore an appropriately named
FinTransmogrifier must be present in the
FinTransmogrifierRepository, if any response data is expected.
In the latter case, the exact Transmogrifiers used to create the order segment and process the response segments are derived by comparing the Bank Parameter Data with the Transmogrifiers available in the FinTransmogrifierRepository.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Parameter xmlOrder was |
System.ArgumentOutOfRangeException | The tag name of the root tag of the XML order did not end with "_Req". |
System.InvalidOperationException | No Transmogrifier matching the XML order was found in the FinTransmogrifierRepository that was given to the constructor. |
Build(XmlElement, String)
Builds a FinXmlOrder from the given XML order data and the expected response tag.
Declaration
public FinXmlOrder Build(XmlElement xmlOrder, string sResponseTag)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlOrder | The XML order data. The syntax of this XML order data must be defined in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrder. |
System.String | sResponseTag | Tag name of the FinTransmogrifier that shall be used to process any
response segments. This may be If this tag name is given, then an appropriate syntax must be defined in the FinTransmogrifierRepository that was given to the constructor of this FinXmlOrder. |
Returns
Type | Description |
---|---|
FinXmlOrder | New FinXmlOrder instance. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Parameter xmlOrder was |
System.InvalidOperationException | No transmogrifier matching the XML order or the response tag was found in the FinTransmogrifierRepository that was given to the constructor. |
GetOrderParameter(String, String)
Returns the requested parameter from the BPD.
Declaration
public string GetOrderParameter(string sOrderTag, string sParameterTag)
Parameters
Type | Name | Description |
---|---|---|
System.String | sOrderTag | XML tag of the order for which the parameter shall be retrieved. This parameter
must be given the base tag name without the version number and |
System.String | sParameterTag | The XML tag of the parameter element in the parameter group. For example,
|
Returns
Type | Description |
---|---|
System.String | If the requested parameter was found then its XML element content is returned as a
string. If the parameter element was empty, then an empty string is returned. If
the requested order or parameter was not found, then |
OrderSupported(String)
Checks whether a particular order type is supported by this FinXmlOrderBuilder instance.
Declaration
public bool OrderSupported(string sOrderTag)
Parameters
Type | Name | Description |
---|---|---|
System.String | sOrderTag | The base Order Tag without version number and without _Req suffix. For example, "SingRemitt" is the base Order Tag for a single remittance. Must not be null. |
Returns
Type | Description |
---|---|
System.Boolean |
Remarks
For an order to be supported a matching order parameter entry must be present in the bank parameter data of this contact and a matching Transmogrifier must be present in the Transmogrifier repository of this FinXmlOrderBuilder instance.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The sOrderTag parameter was null. |
TanRequired(String)
Declaration
public bool TanRequired(string sOrderTag)
Parameters
Type | Name | Description |
---|---|---|
System.String | sOrderTag |
Returns
Type | Description |
---|---|
System.Boolean |
TanSecuritySupported(String)
Declaration
public bool TanSecuritySupported(string sOrderTag)
Parameters
Type | Name | Description |
---|---|---|
System.String | sOrderTag |
Returns
Type | Description |
---|---|
System.Boolean |