Commit e246d27b by zhanghou

开发camt05800108

parent f99f1114
......@@ -28,6 +28,8 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
protected String bodyHdrParentElementName;
protected String bodyHdrParentElementName2;
public Mx2MtContext getContext() {
return context;
}
......@@ -38,6 +40,7 @@ public abstract class AbstractMx2MtTagsGenerate implements Mx2MtTagsGenerate {
appHdrParentElementName = (String) context.get(Mx2MtContextIdentifier.APPHDR_PARENT_ELEMENT_NAME, true);
grpHdrParentElementName = (String) context.get(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, true);
bodyHdrParentElementName = (String) context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
bodyHdrParentElementName2 = (String) context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME2, true);
return this;
}
......
......@@ -16,6 +16,8 @@ public class Mx2MtContextIdentifier {
public static final String BODY_PARENT_ELEMENT_NAME = "body.parent.element.name";
public static final String BODY_PARENT_ELEMENT_NAME2 = "body.parent.element.name2";
public static final String MX_SENDER_BIC = "mx.sender.bic";
public static final String MX_RECEIVER_BIC = "mx.receiver.bic";
......
......@@ -11,6 +11,7 @@ import com.brilliance.swift.mx2mt.mt202Retn.Mx2Mt202RetnCreator;
import com.brilliance.swift.mx2mt.mt202Retn.Mx2Mt205RetnCreator;
import com.brilliance.swift.mx2mt.mt202cov202.Mx2Mt202Creator;
import com.brilliance.swift.mx2mt.mt210.Mx2Mt210Creator;
import com.brilliance.swift.mx2mt.mt292.Mx2Mt292Creator;
import com.brilliance.swift.mx2mt.mt900910.Mx2Mt900910Creator;
import com.brilliance.swift.mx2mt.mt920.Mx2Mt920Creator;
import com.brilliance.swift.mx2mt.mt940950.Mx2Mt940950Creator;
......@@ -119,7 +120,10 @@ public class Mx2MtCreatorManager {
return new Mx2MtN99Creator();
} else if("camt060001".equals(messageType)){
return new Mx2Mt920Creator();
} else {
} else if("camt058001".equals(messageType)){
return new Mx2Mt292Creator();
}
else {
throw new SwiftException("Invalid message type");
}
}
......
package com.brilliance.swift.mx2mt.mt292;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtCreator;
import com.brilliance.swift.mx2mt.Mx2MtContextIdentifier;
import com.brilliance.swift.mx2mt.Mx2MtTagsGenerate;
import com.brilliance.swift.mx2mt.mt292.impl.Field11SGenerate;
import com.brilliance.swift.mx2mt.mt292.impl.Field20Generate;
import com.brilliance.swift.mx2mt.mt292.impl.Field21Generate;
import com.brilliance.swift.mx2mt.mt292.impl.Field79Generate;
import com.brilliance.swift.util.StringUtil;
import com.brilliance.swift.util.XmlUtil;
import com.prowidesoftware.swift.model.SwiftBlock3;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.field.Field121;
import org.dom4j.Document;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public class Mx2Mt292Creator extends AbstractMx2MtCreator {
@Override
public void preProcess() {
super.preProcess();
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
Map<String, String> parentElementMaps = XmlUtil.getParentElementMaps(document);
context.set(Mx2MtContextIdentifier.APPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("AppHdr"));
context.set(Mx2MtContextIdentifier.GRPHDR_PARENT_ELEMENT_NAME, parentElementMaps.get("GrpHdr"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, parentElementMaps.get("OrgnlNtfctn"));
context.set(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME2, parentElementMaps.get("CxlRsn"));
}
@Override
public void withBlock3() throws SwiftException {
super.withBlock3();
SwiftBlock3 block3 = context.get(SwiftMessage.class).getBlock3();
Document document = (Document)context.get(Mx2MtContextIdentifier.MX_XMl_DOCUMENT, true);
String bodyParentPath = (String)context.get(Mx2MtContextIdentifier.BODY_PARENT_ELEMENT_NAME, true);
int orgnlItmCount = getXmlNodeCounts(bodyParentPath, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm");
if(orgnlItmCount>0){
String uetr = getXmlNodeValue(bodyParentPath, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm(0).UETR");
if (StringUtil.isNotEmpty(uetr)) {
Field121 field121 = new Field121(uetr);
block3.builder().setField121(field121);
}
}
}
@Override
public List<Mx2MtTagsGenerate> getGenerateTagList() {
List<Mx2MtTagsGenerate> fieldsGenerateList = new ArrayList<>();
fieldsGenerateList.add(new Field20Generate());
fieldsGenerateList.add(new Field21Generate());
fieldsGenerateList.add(new Field11SGenerate());
fieldsGenerateList.add(new Field79Generate());
return fieldsGenerateList;
}
@Override
protected String getMtType() {
return Mx2MtConstants.MT_TYPE_292;
}
}
package com.brilliance.swift.mx2mt.mt292.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.util.List;
/**
*
*/
public class Field11SGenerate extends AbstractMx2MtTagsGenerate {
private static String name = "11S";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String field11S = "210";
String mtDate = "991231";
String dateStr = getXmlNodeValue(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlCreDtTm");
if (StringUtil.isNotEmpty(dateStr)) {
try {
XMLGregorianCalendar date = DatatypeFactory.newInstance().newXMLGregorianCalendar(dateStr);
mtDate = DateUtil.format(date, "yyMMdd");
} catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
}
}
if("991231".equals(mtDate)){
buildSTErrorInfo(119,"Block4/:11S:",mtDate);
}
tags.add(new Tag(name, field11S + Mx2MtConstants.NEW_LINE + mtDate));
}
}
package com.brilliance.swift.mx2mt.mt292.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
* GrpHdr.MsgId
* AppHdr.BizMsgIdr
*/
public class Field20Generate extends AbstractMx2MtTagsGenerate {
private static String name = "20";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
String messageId = getXmlNodeValue(grpHdrParentElementName, document, "GrpHdr.MsgId");
if (StringUtil.isEmpty(messageId)) {
messageId = getXmlNodeValue(appHdrParentElementName, document, "AppHdr.BizMsgIdr");
}
if (StringUtil.isNotEmpty(messageId)) {
if (messageId.length() > 16) {
buildSTErrorInfo(13, "Block4/:20:", messageId);
messageId = messageId.substring(0, 15) + "+";
}
tags.add(new Tag(name, messageId));
}
}
}
package com.brilliance.swift.mx2mt.mt292.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import java.util.List;
/**
* 取值逻辑:
* field21 = OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm.OrgnlItmId,如果长度大于16,field21 = field21截取15位 + 最后一位用+代替
* 如果filed21 以/开始或者以/结束或者包含//,field21=NONREF
* 否则保持原值不变
*/
public class Field21Generate extends AbstractMx2MtTagsGenerate {
private static String name = "21";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
int orgnlItmCount = getXmlNodeCounts(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm");
if(orgnlItmCount>0){
String orgnlItmId = getXmlNodeValue(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm(0).OrgnlItmId");
if (StringUtil.isNotEmpty(orgnlItmId)) {
if (orgnlItmId.length() > 16) {
buildSTErrorInfo(13, "Block4/:21:", orgnlItmId);
orgnlItmId = orgnlItmId.substring(0, 15) + "+";
}
tags.add(new Tag(name, orgnlItmId));
}
}
}
}
package com.brilliance.swift.mx2mt.mt292.impl;
import com.brilliance.swift.constants.Mx2MtConstants;
import com.brilliance.swift.exception.SwiftException;
import com.brilliance.swift.mx2mt.AbstractMx2MtTagsGenerate;
import com.brilliance.swift.util.DateUtil;
import com.brilliance.swift.util.NumberUtil;
import com.brilliance.swift.util.StringUtil;
import com.prowidesoftware.swift.model.SwiftMessage;
import com.prowidesoftware.swift.model.Tag;
import com.prowidesoftware.swift.model.field.Field121;
import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.XMLGregorianCalendar;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
*/
public class Field79Generate extends AbstractMx2MtTagsGenerate {
private static String name_79 = "79";
private static String name_30 = "30";
private static String name_32 = "32B";
@Override
public void tagGenerate() throws SwiftException {
SwiftMessage swiftMessage = context.get(SwiftMessage.class);
List<Tag> tags = swiftMessage.getBlock4().getTags();
boolean flag30 = false;
boolean flag32B = false;
String mtValDtStr = "";
String amtStr = "";
String ccyStr = "";
int orgnlItmCount = getXmlNodeCounts(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm");
if(orgnlItmCount>0){
String valDtStr = getXmlNodeValue(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm(0).XpctdValDt");
if (StringUtil.isNotEmpty(valDtStr)) {
try {
XMLGregorianCalendar valDt = DatatypeFactory.newInstance().newXMLGregorianCalendar(valDtStr);
mtValDtStr = DateUtil.format(valDt, "yyMMdd");
flag30 = true;
} catch (DatatypeConfigurationException e) {
throw new SwiftException(e.getMessage());
}
}
amtStr = getXmlNodeValue(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm(0).Amt");
ccyStr = getXmlNodeValue(bodyHdrParentElementName, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm(0).Amt@Ccy");
if (StringUtil.isNotEmpty(amtStr) && StringUtil.isNotEmpty(ccyStr)) {
if (NumberUtil.judgeAmtStrExceedLength(amtStr, 14)) {
buildSTErrorInfo(36, "Block4/:"+name_32+":", amtStr);
}
flag32B = true;
}
String uetr = getXmlNodeValue(bodyHdrParentElementName2, document, "OrgnlNtfctn.OrgnlNtfctnRef.OrgnlItm(0).UETR");
String mxReasonCode = getXmlNodeValue(bodyHdrParentElementName2, document, "CxlRsn.Rsn.Cd");
int addtlInfCount = getXmlNodeCounts(bodyHdrParentElementName2, document, "CxlRsn.AddtlInf");
String mxAddtlInf = "";
if (addtlInfCount > 0) {
for (int i=0; i<addtlInfCount; i++) {
if (i == 2) break;
String addtlInf = getXmlNodeValue(bodyHdrParentElementName2, document, "CxlRsn.AddtlInf("+i+")");
if (i == 0) {
mxAddtlInf += addtlInf;
} else {
if (getXmlNodeValue(bodyHdrParentElementName2, document, "CxlRsn.AddtlInf("+(i-1)+")").length() > 104) {
mxAddtlInf += addtlInf;
} else {
mxAddtlInf += " " + addtlInf;
}
}
}
}
String mt79 = "";
if(StringUtil.isNotEmpty(mxReasonCode)){
if(StringUtil.isNotEmpty(mxAddtlInf)&&mxAddtlInf.length()>=6){
Pattern r = Pattern.compile("/[0-9,A-Z]{4}/");
Matcher m = r.matcher(mxAddtlInf.substring(0,6));
if("NARR".equals(mxReasonCode)&&m.matches()){
mt79 += mxAddtlInf;
}else {
mt79 += "/" + mxReasonCode + "/" + mxAddtlInf;
}
}
}
List<String> list = new ArrayList<>();
if (StringUtil.isNotEmpty(mt79)) {
list.addAll(StringUtil.outStringList(mt79, 50, "//"));
}
if(StringUtil.isNotEmpty(uetr)){
list.add("/UETR/" + uetr);
}
String value = "";
for (int i=0; i<list.size(); i++) {
if (i == 35) break;
if (i == 0) {
value = list.get(i);
} else {
value += Mx2MtConstants.NEW_LINE + list.get(i);
}
}
value = mx_to_mtStartingLineCharacter(value, "Block4/:79:");
tags.add(new Tag(name_79, value));
if(StringUtil.isNotEmpty(value)){
if(flag30){
tags.add(new Tag(name_30, mtValDtStr));
}
if(flag32B){
tags.add(new Tag(name_32, ccyStr + NumberUtil.formatAmt(new BigDecimal(amtStr), ccyStr)));
}
}
}
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<RequestPayload>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.02">
<Fr>
<FIId>
<FinInstnId>
<BICFI>HELSFIHHXXX</BICFI>
</FinInstnId>
</FIId>
</Fr>
<To>
<FIId>
<FinInstnId>
<BICFI>NDEAFIHHXXX</BICFI>
</FinInstnId>
</FIId>
</To>
<BizMsgIdr>CNCL-ID001</BizMsgIdr>
<MsgDefIdr>camt.058.001.08</MsgDefIdr>
<BizSvc>swift.cbprplus.02</BizSvc>
<CreDt>2022-07-22T10:17:51.619+08:00</CreDt>
<PssblDplct>false</PssblDplct>
<Prty>NORM</Prty>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:camt.058.001.08">
<NtfctnToRcvCxlAdvc>
<GrpHdr>
<MsgId>CSE-001</MsgId>
<CreDtTm>2022-07-22T10:17:51.619+08:00</CreDtTm>
</GrpHdr>
<OrgnlNtfctn>
<OrgnlMsgId>CNCL-ID001</OrgnlMsgId>
<OrgnlCreDtTm>2022-07-22T10:17:51.619+08:00</OrgnlCreDtTm>
<OrgnlNtfctnId>ZZZZZZ</OrgnlNtfctnId>
<OrgnlNtfctnRef>
<OrgnlItm>
<OrgnlItmId>pacs2bizmsgidr01</OrgnlItmId>
<UETR>8a562c67-ca16-48ba-b074-65581be6f001</UETR>
<Amt Ccy="USD">111</Amt>
<XpctdValDt>2022-10-11</XpctdValDt>
</OrgnlItm>
</OrgnlNtfctnRef>
</OrgnlNtfctn>
<CxlRsn>
<Rsn>
<Cd>DUPL</Cd>
</Rsn>
<AddtlInf>11111111111111</AddtlInf>
</CxlRsn>
</NtfctnToRcvCxlAdvc>
</Document>
</RequestPayload>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<!--- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Legal Notices
SWIFT SCRL@2016. All rights reserved.
This schema is a component of MyStandards, the SWIFT collaborative Web application used to manage
standards definitions and industry usage.
This is a licensed product, which may only be used and distributed in accordance with MyStandards License
Terms as specified in MyStandards Service Description and the related Terms of Use.
Unless otherwise agreed in writing with SWIFT SCRL, the user has no right to:
- authorise external end users to use this component for other purposes than their internal use.
- remove, alter, cover, obfuscate or cancel from view any copyright or other proprietary rights notices appearing in this physical medium.
- re-sell or authorise another party e.g. software and service providers, to re-sell this component.
This component is provided 'AS IS'. SWIFT does not give and excludes any express or implied warranties
with respect to this component such as but not limited to any guarantee as to its quality, supply or availability.
Any and all rights, including title, ownership rights, copyright, trademark, patents, and any other intellectual
property rights of whatever nature in this component will remain the exclusive property of SWIFT or its
licensors.
Trademarks
SWIFT is the trade name of S.W.I.F.T. SCRL.
The following are registered trademarks of SWIFT: the SWIFT logo, SWIFT, SWIFTNet, SWIFTReady, Accord, Sibos, 3SKey, Innotribe, the Standards Forum logo, MyStandards, and SWIFT Institute.
Other product, service, or company names in this publication are trade names, trademarks, or registered trademarks of their respective owners.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Group: Cross Border Payments and Reporting Plus (CBPR+)
Collection: CBPRPlus_ISO 20022_Portfolio_Release 2023
Usage Guideline: CBPRPlus-camt.058.001.08_NotificationToReceiveCancellationAdvice
Base Message: camt.058.001.08
Date of publication: 16 December 2022
URL: https://www2.swift.com/mystandards/#/mp/mx/_UQsRECZ9EeyFELcOlo2Q4w/_qwttUMCMEeynu8TdSFs1cQ
Description: Principles:
1) AGENTS IDENTIFICATION - Textual Rules
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-> If BICFI is present, then (Name & Postal Address) is NOT allowed (ClearingSystemMemberIdentification and LEI may complement) – However, in case of conflicting information, the BICFI will always take precedence.
-> If BICFI is absent, (Name & Postal Address) OR [(Name & Postal Address) and ClearingSystemMemberIdentification] must be present.
Exception: If BICFI is absent, whenever Debtor Agent, Creditor Agent and all agents in between are located within the same country, the clearing code only may be used.
2) Character Set:
All proprietary and Text fields EXCLUDING Name and Address for all actors and Related Remittance Information and Remittance are limited to the FIN-X-Character set.
All Name and Address for all actors, Related Remittance Information and Remittance Information (structured and unstructured), Email Address where included as part of a proxy element are extended to support the following additional characters:
!#$%&*=^_`{|}~";<>@[\]
< is replaced with &lt;
> is replaced with &gt;
4. CBPR_Agent_PointToPointOnSWIFT:
If the transaction is exchanged on the SWIFT network (ie if the instructing agent/sender and instruted agent/receiver of the message are on SWIFT), then BICFI is mandatory and other elements are optional, eg LEI.
Generated by the MyStandards web platform [https://www.swift.com/mystandards] on 2023-06-20T03:50:35+00:00
-->
<xs:schema xmlns="urn:iso:std:iso:20022:tech:xsd:camt.058.001.08" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="urn:iso:std:iso:20022:tech:xsd:camt.058.001.08">
<xs:element name="Document" type="Document"/>
<xs:simpleType name="ActiveCurrencyCode">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{3,3}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="AnyBICDec2014Identifier">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="BICFIDec2014Identifier">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{4,4}[A-Z]{2,2}[A-Z0-9]{2,2}([A-Z0-9]{3,3}){0,1}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="BranchAndFinancialInstitutionIdentification6__1">
<xs:sequence>
<xs:element name="FinInstnId" type="FinancialInstitutionIdentification18__1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="CBPR_Amount_SimpleType">
<xs:restriction base="xs:decimal">
<xs:fractionDigits value="5"/>
<xs:totalDigits value="14"/>
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="CBPR_Amount">
<xs:simpleContent>
<xs:extension base="CBPR_Amount_SimpleType">
<xs:attribute name="Ccy" type="ActiveCurrencyCode" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:simpleType name="CBPR_DateTime">
<xs:restriction base="xs:dateTime">
<xs:pattern value=".*(\+|-)((0[0-9])|(1[0-3])):[0-5][0-9]"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_NotificationToReceiveCancellationReason1Code">
<xs:restriction base="xs:string">
<xs:enumeration value="DUPL"/>
<xs:enumeration value="NARR"/>
<xs:enumeration value="NOLE"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax105Text">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="105"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax140Text_Extended">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ !#$%&amp;\*=^_`\{\|\}~&quot;;&lt;&gt;@\[\\\]]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="140"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax16Text">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="16"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax16Text_Extended">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ !#$%&amp;\*=^_`\{\|\}~&quot;;&lt;&gt;@\[\\\]]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="16"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax28Text">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="28"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax35Text">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ ]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax35Text_Extended">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ !#$%&amp;\*=^_`\{\|\}~&quot;;&lt;&gt;@\[\\\]]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="35"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="CBPR_RestrictedFINXMax70Text_Extended">
<xs:restriction base="xs:string">
<xs:pattern value="[0-9a-zA-Z/\-\?:\(\)\.,'\+ !#$%&amp;\*=^_`\{\|\}~&quot;;&lt;&gt;@\[\\\]]+"/>
<xs:minLength value="1"/>
<xs:maxLength value="70"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="ClearingSystemIdentification2Choice__1">
<xs:choice>
<xs:element name="Cd" type="ExternalClearingSystemIdentification1Code"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="ClearingSystemMemberIdentification2__1">
<xs:sequence>
<xs:element name="ClrSysId" type="ClearingSystemIdentification2Choice__1"/>
<xs:element name="MmbId" type="CBPR_RestrictedFINXMax28Text"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="CountryCode">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z]{2,2}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="DateAndPlaceOfBirth1__1">
<xs:sequence>
<xs:element name="BirthDt" type="ISODate"/>
<xs:element maxOccurs="1" minOccurs="0" name="PrvcOfBirth" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element name="CityOfBirth" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element name="CtryOfBirth" type="CountryCode"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Document">
<xs:sequence>
<xs:element name="NtfctnToRcvCxlAdvc" type="NotificationToReceiveCancellationAdviceV08"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ExternalClearingSystemIdentification1Code">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="5"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ExternalOrganisationIdentification1Code">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ExternalPersonIdentification1Code">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
<xs:maxLength value="4"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="FinancialInstitutionIdentification18__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="BICFI" type="BICFIDec2014Identifier"/>
<xs:element maxOccurs="1" minOccurs="0" name="ClrSysMmbId" type="ClearingSystemMemberIdentification2__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="LEI" type="LEIIdentifier"/>
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="CBPR_RestrictedFINXMax140Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress24__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GenericOrganisationIdentification1__1">
<xs:sequence>
<xs:element name="Id" type="CBPR_RestrictedFINXMax35Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="OrganisationIdentificationSchemeName1Choice__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="CBPR_RestrictedFINXMax35Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GenericPersonIdentification1__1">
<xs:sequence>
<xs:element name="Id" type="CBPR_RestrictedFINXMax35Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="SchmeNm" type="PersonIdentificationSchemeName1Choice__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="Issr" type="CBPR_RestrictedFINXMax35Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="GroupHeader77__1">
<xs:sequence>
<xs:element name="MsgId" type="CBPR_RestrictedFINXMax16Text"/>
<xs:element name="CreDtTm" type="CBPR_DateTime"/>
<xs:element maxOccurs="1" minOccurs="0" name="MsgSndr" type="Party40Choice__1"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="ISODate">
<xs:restriction base="xs:date"/>
</xs:simpleType>
<xs:simpleType name="LEIIdentifier">
<xs:restriction base="xs:string">
<xs:pattern value="[A-Z0-9]{18,18}[0-9]{2,2}"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="NotificationCancellationReason1Choice__1">
<xs:choice>
<xs:element name="Cd" type="CBPR_NotificationToReceiveCancellationReason1Code"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="NotificationCancellationReason1__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Orgtr" type="PartyIdentification135__1"/>
<xs:element name="Rsn" type="NotificationCancellationReason1Choice__1"/>
<xs:element maxOccurs="2" minOccurs="0" name="AddtlInf" type="CBPR_RestrictedFINXMax105Text"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="NotificationToReceiveCancellationAdviceV08">
<xs:sequence>
<xs:element name="GrpHdr" type="GroupHeader77__1"/>
<xs:element name="OrgnlNtfctn" type="OriginalNotification14__1"/>
<xs:element name="CxlRsn" type="NotificationCancellationReason1__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OrganisationIdentification29__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="AnyBIC" type="AnyBICDec2014Identifier"/>
<xs:element maxOccurs="1" minOccurs="0" name="LEI" type="LEIIdentifier"/>
<xs:element maxOccurs="2" minOccurs="0" name="Othr" type="GenericOrganisationIdentification1__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OrganisationIdentificationSchemeName1Choice__1">
<xs:choice>
<xs:element name="Cd" type="ExternalOrganisationIdentification1Code"/>
<xs:element name="Prtry" type="CBPR_RestrictedFINXMax35Text"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="OriginalItem7__1">
<xs:sequence>
<xs:element name="OrgnlItmId" type="CBPR_RestrictedFINXMax16Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="OrgnlEndToEndId" type="CBPR_RestrictedFINXMax35Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="UETR" type="UUIDv4Identifier"/>
<xs:element name="Amt" type="CBPR_Amount"/>
<xs:element maxOccurs="1" minOccurs="0" name="XpctdValDt" type="ISODate"/>
<xs:element maxOccurs="1" minOccurs="0" name="OrgnlItmRef" type="OriginalItemReference6__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OriginalItemReference6__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="Party40Choice__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification6__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OriginalNotification14__1">
<xs:sequence>
<xs:element name="OrgnlMsgId" type="CBPR_RestrictedFINXMax35Text"/>
<xs:element maxOccurs="1" minOccurs="0" name="OrgnlCreDtTm" type="CBPR_DateTime"/>
<xs:element name="OrgnlNtfctnId" type="CBPR_RestrictedFINXMax35Text"/>
<xs:element name="OrgnlNtfctnRef" type="OriginalNotificationReference12__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="OriginalNotificationReference12__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Dbtr" type="Party40Choice__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="DbtrAgt" type="BranchAndFinancialInstitutionIdentification6__1"/>
<xs:element maxOccurs="unbounded" minOccurs="1" name="OrgnlItm" type="OriginalItem7__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="Party38Choice__1">
<xs:choice>
<xs:element name="OrgId" type="OrganisationIdentification29__1"/>
<xs:element name="PrvtId" type="PersonIdentification13__1"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="Party40Choice__1">
<xs:choice>
<xs:element name="Pty" type="PartyIdentification135__1"/>
<xs:element name="Agt" type="BranchAndFinancialInstitutionIdentification6__1"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="PartyIdentification135__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Nm" type="CBPR_RestrictedFINXMax140Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="PstlAdr" type="PostalAddress24__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="Id" type="Party38Choice__1"/>
<xs:element maxOccurs="1" minOccurs="0" name="CtryOfRes" type="CountryCode"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PersonIdentification13__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="DtAndPlcOfBirth" type="DateAndPlaceOfBirth1__1"/>
<xs:element maxOccurs="2" minOccurs="0" name="Othr" type="GenericPersonIdentification1__1"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PersonIdentificationSchemeName1Choice__1">
<xs:choice>
<xs:element name="Cd" type="ExternalPersonIdentification1Code"/>
<xs:element name="Prtry" type="CBPR_RestrictedFINXMax35Text"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="PostalAddress24__1">
<xs:sequence>
<xs:element maxOccurs="1" minOccurs="0" name="Dept" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="SubDept" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="StrtNm" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="BldgNb" type="CBPR_RestrictedFINXMax16Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="BldgNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="Flr" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="PstBx" type="CBPR_RestrictedFINXMax16Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="Room" type="CBPR_RestrictedFINXMax70Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="PstCd" type="CBPR_RestrictedFINXMax16Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="TwnNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="TwnLctnNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="DstrctNm" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="CtrySubDvsn" type="CBPR_RestrictedFINXMax35Text_Extended"/>
<xs:element maxOccurs="1" minOccurs="0" name="Ctry" type="CountryCode"/>
<xs:element maxOccurs="3" minOccurs="0" name="AdrLine" type="CBPR_RestrictedFINXMax35Text_Extended"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="UUIDv4Identifier">
<xs:restriction base="xs:string">
<xs:pattern value="[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
......@@ -139,6 +139,11 @@ public class Mx2MtTest {
}
@Test
public void test292_2() {
test("/swiftXml/camt05800108.xml", null);
}
@Test
public void testXmlFilePath() {
SwiftTranslationReport str = SwiftTransfer.mx2MtPlus("d:/test/MxPacs00800108.xml", true, null, null);
System.out.println(str.getMessage());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment