Class EbicsXmlContainer

Namespace
Subsembly.EBICS
Assembly
Subsembly.EBICS.Core.dll

Represents an XML container for SEPA messages.

public class EbicsXmlContainer : EbicsElement, ICollection<EbicsXmlContainerMessage>, IEnumerable<EbicsXmlContainerMessage>, IEnumerable
Inheritance
EbicsXmlContainer
Implements
Inherited Members

Remarks

Only the XML container formats starting with version 2.5 of the "Specification of Data Formats" are supported. These are currently defined by the namespaces "urn:conxml:xsd:container.nnn.002.02", "urn:conxml:xsd:container.nnn.003.02", and "urn:conxml:xsd:container.nnn.001.02" Older XML container formats are not supported.

Constructors

EbicsXmlContainer(string, string)

Creates a new, empty XML container.

public EbicsXmlContainer(string sNamespace = null, string sSchemaLocation = null)

Parameters

sNamespace string

Optional the XML namespace URI of the new XML container. Currently this can be either NAMESPACE_CONTAINER_NNN_002_02, NAMESPACE_CONTAINER_NNN_003_02, NAMESPACE_CONTAINER_NNN_001_02, or NAMESPACE_CONTAINER_NNN_001_04. The required namespace depends on the type of SEPA pain messages that shall be contained in the container. Use GetNamespace(string) in order to determine the correct namespace from a SEPA pain identifier. If this is null or an empty string, then the namespace will be automatically determined from the type SEPA XML documents that are added via AddMessage(XmlElement, string, string).

sSchemaLocation string

Optional XML schema location for conxml container. If this is provided, then a schemaLocation attribute will be included at the conxml root element of the XML document. If this is null or an empty string, then no schemaLocation attribute will be included in the XML document.

Fields

NAMESPACE_CONTAINER_NNN_001_02

"urn:conxml:xsd:container.nnn.001.02"

public const string NAMESPACE_CONTAINER_NNN_001_02 = "urn:conxml:xsd:container.nnn.001.02"

Field Value

string

Remarks

A container in this namespace may contain "pain.001.001.03", "pain.008.001.02", or "pain.002.001.03" messages.

NAMESPACE_CONTAINER_NNN_001_04

"urn:conxml:xsd:container.nnn.001.GBIC4"

public const string NAMESPACE_CONTAINER_NNN_001_04 = "urn:conxml:xsd:container.nnn.001.GBIC4"

Field Value

string

Remarks

A container in this namespace may contain "pain.001.001.09", "pain.008.001.08", or "pain.007.001.09" messages.

NAMESPACE_CONTAINER_NNN_002_02

"urn:conxml:xsd:container.nnn.002.02"

public const string NAMESPACE_CONTAINER_NNN_002_02 = "urn:conxml:xsd:container.nnn.002.02"

Field Value

string

Remarks

A container in this namespace may contain "pain.001.002.03", "pain.008.002.02", or "pain.002.002.03" messages.

NAMESPACE_CONTAINER_NNN_003_02

"urn:conxml:xsd:container.nnn.003.02"

public const string NAMESPACE_CONTAINER_NNN_003_02 = "urn:conxml:xsd:container.nnn.003.02"

Field Value

string

Remarks

A container in this namespace may contain "pain.001.003.03", "pain.008.003.02", or "pain.002.003.03" messages.

Properties

Count

public int Count { get; }

Property Value

int

CreationDateTime

The local date and time when the message was created.

public DateTime CreationDateTime { get; }

Property Value

DateTime

Remarks

This will either be read from XML, or be generated automatically when the container is written for the first time.

IdType

Optional IdType.

public string IdType { get; set; }

Property Value

string

Remarks

If no SenderId was set, then no ContainerId element will be generated at all and thus the value of this property is never used. If this is null or an empty string, and a SenderId was set, then the default value "EBIC" will be used when generating the XML.

Exceptions

ArgumentException

A string longer than 4 characters was given.

See Also

Namespace

The XML namespace of this container.

public string Namespace { get; }

Property Value

string

SchemaLocation

Optional XML schema location for conxml container.

public string SchemaLocation { get; set; }

Property Value

string

Remarks

If this is provided, then a schemaLocation attribute will be included at the conxml root element of the XML document. If this is null or an empty string, then no schemaLocation attribute will be included in the XML document.

SenderId

Optional SenderId.

public string SenderId { get; set; }

Property Value

string

Remarks

In the context of an EBICS transaction this should be the EBICS user ID. If no SenderId was set, then no ContainerId element will be generated.

Exceptions

ArgumentException

A string longer than 22 characters was given.

See Also

TimeStamp

TimeStamp from the container ID.

public string TimeStamp { get; }

Property Value

string

Remarks

This will either be read from XML, or be generated automatically when the container is written for the first time. If no SenderId was set, then no ContainerId element will be generated at all and thus the value of this property is never used.

Methods

Add(EbicsXmlContainerMessage)

public void Add(EbicsXmlContainerMessage aMsg)

Parameters

aMsg EbicsXmlContainerMessage

Exceptions

ArgumentNullException

The parameter was null.

NotSupportedException

Either the Namespace or the MessageTag is not supported by this container.

AddMessage(EbicsDataBuffer, string, string)

Add another XML message document to this container.

public EbicsXmlContainerMessage AddMessage(EbicsDataBuffer aMessageBuffer, string sMessageTag = null, string sNamespace = null)

Parameters

aMessageBuffer EbicsDataBuffer

A binary blob containing the XML message document to be added to this container.

sMessageTag string

The XML tag that shall be used by this message inside the XML container. Currently this must be either "MsgPain001", "MsgPain002", or "MsgPain008". The required tag depends on the type of SEPA pain message. Use GetMessageTag(string) in order to determine the correct tag from a SEPA pain identifier. If this parameter is null, then an attempt is made to derived the required message tag from the XML document itself.

sNamespace string

Optional the XML namespace URI required for the XML container. Currently this can be either NAMESPACE_CONTAINER_NNN_002_02, NAMESPACE_CONTAINER_NNN_003_02, NAMESPACE_CONTAINER_NNN_001_02, or NAMESPACE_CONTAINER_NNN_001_04. The required namespace depends on the type of SEPA pain message. Use GetNamespace(string) in order to determine the correct namespace from a SEPA pain identifier. If this parameter is null or an empty string, then an attempt is made to derive the required namespace from the XML document itself.

Returns

EbicsXmlContainerMessage

Exceptions

ArgumentNullException

The parameter aMessageBuffer was null.

ArgumentException

Either the parameter sMessageTag or the parameter sNamespace was not given and could also not be determined from the given XML document.

NotSupportedException

The given xmlDocument is not supported by this container.

See Also

AddMessage(XmlElement, string, string)

Add another XML message document to this container.

public EbicsXmlContainerMessage AddMessage(XmlElement xmlDocument, string sMessageTag = null, string sNamespace = null)

Parameters

xmlDocument XmlElement

The XML root element of the XML document that shall be added to this container. Usually this is the root element of a SEPA XML document.

sMessageTag string

The XML tag that shall be used by this message inside the XML container. Currently this must be either "MsgPain001", "MsgPain002", or "MsgPain008". The required tag depends on the type of SEPA pain message. Use GetMessageTag(string) in order to determine the correct tag from a SEPA pain identifier. If this parameter is null or an empty string, then an attempt is made to derive the required message tag from the XML document itself.

sNamespace string

Optional the XML namespace URI required for the XML container. Currently this can be either NAMESPACE_CONTAINER_NNN_002_02, NAMESPACE_CONTAINER_NNN_003_02, NAMESPACE_CONTAINER_NNN_001_02, or NAMESPACE_CONTAINER_NNN_001_04. The required namespace depends on the type of SEPA pain message. Use GetNamespace(string) in order to determine the correct namespace from a SEPA pain identifier. If this parameter is null or an empty string, then an attempt is made to derive the required namespace from the XML document itself.

Returns

EbicsXmlContainerMessage

Exceptions

ArgumentNullException

The parameter xmlDocument was null.

ArgumentException

Either the parameter sMessageTag or the parameter sNamespace was not given and could also not be determined from the given XML document.

NotSupportedException

The given xmlDocument is not supported by this container.

See Also

BuildXml(XmlDocument, EbicsVersion)

public override XmlElement BuildXml(XmlDocument xmlDocument, EbicsVersion nVersion)

Parameters

xmlDocument XmlDocument
nVersion EbicsVersion

Always use ConXml to build the XML-Container.

Returns

XmlElement

Contains(EbicsXmlContainerMessage)

public bool Contains(EbicsXmlContainerMessage aMsg)

Parameters

aMsg EbicsXmlContainerMessage

Returns

bool

CopyTo(EbicsXmlContainerMessage[], int)

public void CopyTo(EbicsXmlContainerMessage[] vArray, int nIndex)

Parameters

vArray EbicsXmlContainerMessage[]
nIndex int

GetEnumerator()

public IEnumerator<EbicsXmlContainerMessage> GetEnumerator()

Returns

IEnumerator<EbicsXmlContainerMessage>

GetMessageTag(string)

Provides the XML tag to be used for a contained message with a particular SEPA pain version.

public static string GetMessageTag(string sPainId)

Parameters

sPainId string

The complete SEPA pain ID for which to determine the appropriate XML tag. This must be a string like "pain.001.002.03" or "pain.008.003.03".

Returns

string

GetNamespace(string)

Provides the URI of the container namespace that shall be used with a particular SEPA pain version.

public static string GetNamespace(string sPainId)

Parameters

sPainId string

The complete SEPA pain ID for which to determine the appropriate XML container namespace. This must be a string like "pain.001.002.03" or "pain.008.003.03".

Returns

string

If there is a known container namespace for given SEPA pain ID, then that namespace URI is returned. If the given SEPA pain ID is not known or supported, then null is returned.

See Also

GetSchemaLocation(string)

Provides the default XML schema location for a given XML container namespace.

public static string GetSchemaLocation(string sNamespace)

Parameters

sNamespace string

The XML namespace URI of the XML container.

Returns

string

If the XML namespace URI is known and supported, then its default XML schema location is returned. Otherwise null is returned.

See Also

ParseXml(XmlElement, EbicsVersion)

public override void ParseXml(XmlElement xmlElement, EbicsVersion nVersion)

Parameters

xmlElement XmlElement
nVersion EbicsVersion

Always use ConXml to parse the XML-Container.

Remove(EbicsXmlContainerMessage)

public bool Remove(EbicsXmlContainerMessage aMsg)

Parameters

aMsg EbicsXmlContainerMessage

Returns

bool