Class EbicsXmlContainer
Represents an XML container for SEPA messages.
Implements
Inherited Members
Namespace: Subsembly.EBICS
Assembly: Subsembly.EBICS.Core.dll
Syntax
public class EbicsXmlContainer : EbicsElement, ICollection<EbicsXmlContainerMessage>, IEnumerable<EbicsXmlContainerMessage>, IEnumerable
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.
Declaration
public EbicsXmlContainer(string sNamespace = null, string sSchemaLocation = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | sNamespace | 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 |
System.String | sSchemaLocation | 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 |
Fields
NAMESPACE_CONTAINER_NNN_001_02
"urn:conxml:xsd:container.nnn.001.02"
Declaration
public const string NAMESPACE_CONTAINER_NNN_001_02 = "urn:conxml:xsd:container.nnn.001.02"
Field Value
Type | Description |
---|---|
System.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"
Declaration
public const string NAMESPACE_CONTAINER_NNN_001_04 = "urn:conxml:xsd:container.nnn.001.GBIC4"
Field Value
Type | Description |
---|---|
System.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"
Declaration
public const string NAMESPACE_CONTAINER_NNN_002_02 = "urn:conxml:xsd:container.nnn.002.02"
Field Value
Type | Description |
---|---|
System.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"
Declaration
public const string NAMESPACE_CONTAINER_NNN_003_02 = "urn:conxml:xsd:container.nnn.003.02"
Field Value
Type | Description |
---|---|
System.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
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
CreationDateTime
The local date and time when the message was created.
Declaration
public DateTime CreationDateTime { get; }
Property Value
Type | Description |
---|---|
System.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.
Declaration
public string IdType { get; set; }
Property Value
Type | Description |
---|---|
System.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
Type | Condition |
---|---|
System.ArgumentException | A string longer than 4 characters was given. |
See Also
Namespace
The XML namespace of this container.
Declaration
public string Namespace { get; }
Property Value
Type | Description |
---|---|
System.String |
SchemaLocation
Optional XML schema location for conxml container.
Declaration
public string SchemaLocation { get; set; }
Property Value
Type | Description |
---|---|
System.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.
Declaration
public string SenderId { get; set; }
Property Value
Type | Description |
---|---|
System.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
Type | Condition |
---|---|
System.ArgumentException | A string longer than 22 characters was given. |
See Also
TimeStamp
TimeStamp from the container ID.
Declaration
public string TimeStamp { get; }
Property Value
Type | Description |
---|---|
System.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)
Declaration
public void Add(EbicsXmlContainerMessage aMsg)
Parameters
Type | Name | Description |
---|---|---|
EbicsXmlContainerMessage | aMsg |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter was |
System.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.
Declaration
public EbicsXmlContainerMessage AddMessage(EbicsDataBuffer aMessageBuffer, string sMessageTag = null, string sNamespace = null)
Parameters
Type | Name | Description |
---|---|---|
EbicsDataBuffer | aMessageBuffer | A binary blob containing the XML message document to be added to this container. |
System.String | sMessageTag | 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 |
System.String | sNamespace | 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 |
Returns
Type | Description |
---|---|
EbicsXmlContainerMessage |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter aMessageBuffer was |
System.ArgumentException | Either the parameter sMessageTag or the parameter sNamespace was not given and could also not be determined from the given XML document. |
System.NotSupportedException | The given xmlDocument is not supported by this container. |
See Also
AddMessage(XmlElement, String, String)
Add another XML message document to this container.
Declaration
public EbicsXmlContainerMessage AddMessage(XmlElement xmlDocument, string sMessageTag = null, string sNamespace = null)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlDocument | 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. |
System.String | sMessageTag | 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 |
System.String | sNamespace | 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 |
Returns
Type | Description |
---|---|
EbicsXmlContainerMessage |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The parameter xmlDocument was |
System.ArgumentException | Either the parameter sMessageTag or the parameter sNamespace was not given and could also not be determined from the given XML document. |
System.NotSupportedException | The given xmlDocument is not supported by this container. |
See Also
BuildXml(XmlDocument, EbicsVersion)
Declaration
public override XmlElement BuildXml(XmlDocument xmlDocument, EbicsVersion nVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlDocument | xmlDocument | |
EbicsVersion | nVersion | Always use ConXml to build the XML-Container. |
Returns
Type | Description |
---|---|
System.Xml.XmlElement |
Overrides
Contains(EbicsXmlContainerMessage)
Declaration
public bool Contains(EbicsXmlContainerMessage aMsg)
Parameters
Type | Name | Description |
---|---|---|
EbicsXmlContainerMessage | aMsg |
Returns
Type | Description |
---|---|
System.Boolean |
CopyTo(EbicsXmlContainerMessage[], Int32)
Declaration
public void CopyTo(EbicsXmlContainerMessage[] vArray, int nIndex)
Parameters
Type | Name | Description |
---|---|---|
EbicsXmlContainerMessage[] | vArray | |
System.Int32 | nIndex |
GetEnumerator()
Declaration
public IEnumerator<EbicsXmlContainerMessage> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<EbicsXmlContainerMessage> |
GetMessageTag(String)
Provides the XML tag to be used for a contained message with a particular SEPA pain version.
Declaration
public static string GetMessageTag(string sPainId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sPainId | 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
Type | Description |
---|---|
System.String |
GetNamespace(String)
Provides the URI of the container namespace that shall be used with a particular SEPA pain version.
Declaration
public static string GetNamespace(string sPainId)
Parameters
Type | Name | Description |
---|---|---|
System.String | sPainId | 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
Type | Description |
---|---|
System.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 |
See Also
GetSchemaLocation(String)
Provides the default XML schema location for a given XML container namespace.
Declaration
public static string GetSchemaLocation(string sNamespace)
Parameters
Type | Name | Description |
---|---|---|
System.String | sNamespace | The XML namespace URI of the XML container. |
Returns
Type | Description |
---|---|
System.String | If the XML namespace URI is known and supported, then its default XML schema
location is returned. Otherwise |
See Also
ParseXml(XmlElement, EbicsVersion)
Declaration
public override void ParseXml(XmlElement xmlElement, EbicsVersion nVersion)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlElement | xmlElement | |
EbicsVersion | nVersion | Always use ConXml to parse the XML-Container. |
Overrides
Remove(EbicsXmlContainerMessage)
Declaration
public bool Remove(EbicsXmlContainerMessage aMsg)
Parameters
Type | Name | Description |
---|---|---|
EbicsXmlContainerMessage | aMsg |
Returns
Type | Description |
---|---|
System.Boolean |
Explicit Interface Implementations
ICollection<EbicsXmlContainerMessage>.Clear()
Declaration
void ICollection<EbicsXmlContainerMessage>.Clear()
ICollection<EbicsXmlContainerMessage>.IsReadOnly
Declaration
bool ICollection<EbicsXmlContainerMessage>.IsReadOnly { get; }
Returns
Type | Description |
---|---|
System.Boolean |
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator |