Giter VIP home page Giter VIP logo

prowide-iso20022's Introduction

alt tag

Prowide ISO 20022 is an open source Java framework for managing ISO 20022 messages.

This project is a complement for the Prowide Core library: https://github.com/prowide/prowide-core

What's included?

  • Java model for ISO 20022 MX (for example: pacs.008.001.02, for all ISO 20022 message categories and types)
  • Parser from ISO 20022 XML into Java
  • Builder API from Java to ISO 20022 XML
  • Conversion to/from JSON

For SWIFT messages validation, restricted ISO versions (such as SEPA, CBPR+, TARGET), GUI application and more, please check our complementary commercial offerings at https://www.prowidesoftware.com/

Documentation

Distribution

Latest public binary DOWNLOAD is available at https://dev.prowidesoftware.com/SRU2022/getting-started/download-iso20022/

SRU updates are made available in October (one month before SWIFT production date) for the public, and 6 months in advance for subscribed customers.

License

Apache License 2.0

SWIFT is a trademark of S.W.I.F.T. SCRL. (www.swift.com)

Dependencies

This project depends on https://github.com/prowide/prowide-core

The project also needs the javax.xml.bind in runtime. Until Java 8 this package is part of the JDK. If you use Java above 8 you might need to activate the required modules in the JDK; or add these dependencies (or an equivalent implementation) to your application:

implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'com.sun.xml.bind:jaxb-impl:2.3.3'

Build

For better build performance, local configurations can be setup in a gradle.properties file such as:

org.gradle.jvmargs=-Xms512m -Xmx7g
org.gradle.parallel=true

To compile and test all modules: ./gradlew build

Modules

The project is huge because it contains the complete set of jaxb generated the project is divided into multiple subprojects though as follows:

  • iso20022-core: main common code and base classes for all modules, including API for headers
  • model-common-types: common business types dictionary for many message categories
  • model-[category]-mx: the Document classes for each specific category (entry point for each message type)
  • model-[category]-types: business types dictionary for each specific category

The dependencies being:

iso20022-core
  \-- model-common-types
model-[category]-types
  \-- model-common-types
model-[category]-mx
  +-- iso20022-core
  +-- model-[category]-types
  \-- model-common-types

Artifacts

The root project creates an uber jar named pw-iso20022-SRUYYYY-version.jar with the library API for all ISO20022 message categories: pacs, camt, xsys, sese, etc... So if you need to process many message types, or you want to keep your dependencies simple, you can just take the single jar output. This is also the jar published in Maven Central.

If instead of depending on the uber jar you want to have a subset of the library for some message types you can just take the base and common jars and the specific category modules. For instance to use ony the pacs and camt messages, you need:

  • iso20022-core -> pw-iso20022-core-SRUYYYY-version.jar
  • model-common-types -> pw-iso20022-common-types-SRUYYYY-version.jar
  • model-pacs-mx -> pw-iso20022-pacs-mx-SRUYYYY-version.jar
  • model-pacs-types -> pw-iso20022-pacs-types-SRUYYYY-version.jar
  • model-camt-mx -> pw-iso20022-camt-mx-SRUYYYY-version.jar
  • model-camt-types -> pw-iso20022-camt-types-SRUYYYY-version.jar

In this case, you can run the following commands:

./gradlew :iso20022-core:jar

./gradlew :model-common-types:jar

./gradlew :model-pacs-mx:jar

./gradlew :model-pacs-types:jar

./gradlew :model-camt-mx:jar

./gradlew :model-camt-types:jar

This will create individual jars in each module folder, so you can use each lib as needed.

prowide-iso20022's People

Contributors

fernando-prowide avatar fernandodesarriera avatar gems avatar ptorres-prowide avatar zubri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

prowide-iso20022's Issues

Retro-compatibility with dates between v9 and v10

Hello,

Between v9 and V10 versions, the dates format have changed.
I don’t see anything in the v10 to be compatible with v9 date format.

Is there any custom adapter (or possibility to add one) to able to deserialize the « old » date format (or any other solution ) ?

Many thanks in advance.
Regards

Using OffsetDateTime is questionable

Version 10 moved from XMLGregorianCalendar to OffsetDateTime.

This is a bad choice because:

  1. Zone offsets are optional (quote from ISO20022_MDRPart2_GeneralMeeting_2021_2022.pdf):
ISODateTime

Definition: A particular point in the progression of time defined by a mandatory date and a mandatory
time component, expressed in either UTC time format (YYYY-MM-DDThh:mm:ss.sssZ), local time with
UTC offset format (YYYY-MM-DDThh:mm:ss.sss+/-hh:mm), or local time format (YYYY-MMDDThh:
mm:ss.sss). These representations are defined in "XML Schema Part 2: Datatypes Second
Edition - W3C Recommendation 28 October 2004" which is aligned with ISO 8601. [...]
  1. OffsetDateTime does not support the concept of unknown / missing time zones. With XMLGregorianCalendar it was possible to check fields against FIELD_UNDEFINED:
XMLGregorianCalendar calendar = ...;
if (calendar.getTimezone() == DatatypeConstants.FIELD_UNDEFINED) {
    ...
}

I can work around this issue by replacing com.prowidesoftware.swift.model.mx.adapters.OffsetDateTimeAdapter.

There is no action required from your side, I just wanted to point out this problem. (Maybe the default adapter could treat missing offsets as system time zone, but that's also questionable. The time zone of the sender would be better, but cannot be determined from the MX message.)

setup LGTM

Screen Shot 2020-10-04 at 20 55 16

Ya esta integrado al project pero falla el build extraction. Hay que ver bien por que falla y agregarle un file de settings con lo que haga falta para que levante el proyecto. Lo que nos interesa que analice es el modelo iso20022-core, los otros de codigo generado no hace falta porque es generado de JAXB.

Create MxPain00800102 message with schemaLocation in Document element

Hello,

is it possible to add a schmemaLocation to the Document element?
E.g.
at the moment I get <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02">
my goal is to get <Document xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.001.02 pain.008.001.02.xsd">

Best regards
George

Error: java.lang.ClassNotFoundException

Hello,

I'm having problems running an application in an approval environment,
I'm using a pw-swift-core/SRU2021-9.2.13 library,

Dependencies installed in pom.xml

<dependency>
        <groupId>org.apache.commons</groupId>
      	<artifactId>commons-lang3</artifactId>
      	<version>3.12.0</version>
    </dependency>
 <dependency>
	<groupId>com.google.code.gson</groupId>
	<artifactId>gson</artifactId>
	<version>2.8.9</version>
</dependency>
<dependency>
        <groupId>com.prowidesoftware</groupId>
         <artifactId>pw-swift-core</artifactId>
         <version>SRU2021-9.2.13</version>
</dependency>

the error below is occurring
please help.

Caused by: java.lang.NoClassDefFoundError: com.prowidesoftware.swift.model.field.Field
at java.lang.J9VMInternals.prepareClassImpl(Native Method)
at java.lang.J9VMInternals.prepare(J9VMInternals.java:302)
at java.lang.Class.getDeclaredMethods(Class.java:975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnot
ationBeanPostProcessor.java:247)
... 12 more
Caused by: java.lang.ClassNotFoundException: com.prowidesoftware.swift.model.field.Field
at java.net.URLClassLoader.findClass(URLClassLoader.java:610)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:925)
at java.lang.ClassLoader.loadClass(ClassLoader.java:870)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:853)
... 19 more

exit 1

JSON Serialization / Deserialization errors of XMLGregorianCalendar backed date fields of MX objects

Hello,

I have an issue when manipulating MX serialized as JSON files with various versions of JVMs (tested with Hotspot OpenJDK 1.8, 14 and 15).

Let's take for example a minimalist MX example with just a date (not valid as such, but it's to illustrate the problem which occurs with every date fields):

<?xml version="1.0" encoding="UTF-8" ?>
<RequestPayload>
<Doc:Document xmlns:Doc="urn:swift:xsd:sese.023.002.01">
    <Doc:SctiesSttlmTxInstr>
        <Doc:Id>
            <Doc:CreDtTm>
                <Doc:Dt>2021-02-03</Doc:Dt>
            </Doc:CreDtTm>
        </Doc:Id>
    </Doc:SctiesSttlmTxInstr>
</Doc:Document>
</RequestPayload>

When I parse and convert this to a JSON output doing a simple AbstractMX.parse(source).toJson(), here is the output I obtain:

{
  "sctiesSttlmTxInstr": {
    "id": {
      "creDtTm": {
        "dt": {
          "year": 2021,
          "month": 2,
          "day": 3,
          "timezone": -2147483648,
          "hour": -2147483648,
          "minute": -2147483648,
          "second": -2147483648
        }
      }
    }
  },
  "type": "MX",
  "@xmlns": "urn:swift:xsd:sese.023.002.01",
  "identifier": "sese.023.002.01"
}

It serializes the XMLGregorianCalendar instance as complex object with every attributes mentionned, with some other libraries I get instead a string (for example 2021-02-03) but anyway, here's the real problem:

If I want to load again the MX from its JSON serialization, the dates fields throw a NullPointerException on line 68 of XMLGregorianCalendarAdapter.java file:

xmlGregCalendar.setFractionalSecond(obj.get(FRACTIONAL).getAsBigDecimal());

Because the return value in this case of obj.get(FRACTIONAL) is null

Because of this error, dates are lost and the corresponding fields are null objects in the parsed AbstractMX instance, thus if I reserialize this object I get the following output:

{
  "sctiesSttlmTxInstr": {
    "id": {
      "creDtTm": {}
    }
  },
  "type": "MX",
  "@xmlns": "urn:swift:xsd:sese.023.002.01",
  "identifier": "sese.023.002.01"
}

However, if I tweak the generated JSON to add the fractionalSecond field manually, the following test pass correctly and the dates are correctly deserialized / serialized:

    @Test
    public void testCustomJson()
    {
        String source = """
{
  "sctiesSttlmTxInstr": {
    "id": {
      "creDtTm": {
        "dt": {
          "year": 2021,
          "month": 2,
          "day": 3,
          "timezone": -2147483648,
          "hour": -2147483648,
          "minute": -2147483648,
          "second": -2147483648,
          "fractionalSecond": 0
        }
      }
    }
  },
  "type": "MX",
  "@xmlns": "urn:swift:xsd:sese.023.002.01",
  "identifier": "sese.023.002.01"
}""";
        AbstractMX mx = AbstractMX.fromJson(source);
        assertEquals(source, mx.toJson());
    }

What I expect is the following test to pass:

    @Test
    public void testMxDateJsonSerializeAndParse()
    {
        String source = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n" +
                "<RequestPayload>\n" +
                "<Doc:Document xmlns:Doc=\"urn:swift:xsd:sese.023.002.01\">\n" +
                "    <Doc:SctiesSttlmTxInstr>\n" +
                "        <Doc:Id>\n" +
                "            <Doc:CreDtTm>\n" +
                "                <Doc:Dt>2021-02-03</Doc:Dt>\n" +
                "            </Doc:CreDtTm>\n" +
                "        </Doc:Id>\n" +
                "    </Doc:SctiesSttlmTxInstr>\n" +
                "</Doc:Document>\n" +
                "</RequestPayload>";
        AbstractMX mx = AbstractMX.parse(source);
        String json = mx.toJson();
        AbstractMX mx2 = AbstractMX.fromJson(json);
        String json2 = mx2.toJson();
        assertEquals(mx, mx2);
        assertEquals(json, json2);
    }

Technical fix of this issue is quite easy, I'm preparing a PR with an example of fix but it's more a matter of the default functional value you want in the serialized JSON for the fractionalSecond field (not present like currently, present with a default 0 or any other form of decimal 0 value)

Cant parse ClrSysMmbId from AppHeader

Hi im trying to parse pacs008 and pacs009 using your library

When I try to parse a pacs008/pacs009 file appheader which contains this:
< FinInstnId >
< ClrSysMmbId >
< MmbId > ABCDEFGH < /MmbId >
< /ClrSysMmbId >
< /FinInstnId >

the parser returns NULL for "From" and "To" elements in the AppHdr.

But when < FinInstnId > uses "BICFI" , everything is well.

So how do I properly use your library to parse "< ClrSysMmbId >" under AppHdr?

Parsing issue with MX message of type admi.007.001.01

Hello,

We are facing a problem while parsing an MX message of type admi.007.001.01 using SRU2020-9.1.5 version. Upgrading to SRU2021-9.2.5 version doesn't resolve the issue.

This is an example of an admi.007.001.01 message:

<?xml version="1.0" encoding="ISO-8859-1"?>
<Body>
    <AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01">
        <Fr>
            <FIId>
                <FinInstnId>
                    <BICFI>XXXXXXXXXXX</BICFI>
                </FinInstnId>
            </FIId>
        </Fr>
        <To>
            <FIId>
                <FinInstnId>
                    <BICFI>XXXXXXXXXXX</BICFI>
                </FinInstnId>
            </FIId>
        </To>
        <BizMsgIdr>XXXXXXX</BizMsgIdr>
        <MsgDefIdr>admi.007.001.01</MsgDefIdr>
        <CreDt>2022-01-11T15:02:09Z</CreDt>
    </AppHdr>
    <Document xmlns="urn:iso:std:iso:20022:tech:xsd:admi.007.001.01">
        <RctAck>
            <MsgId>
                <MsgId>XXXXXXX</MsgId>
            </MsgId>
            <Rpt>
                <RltdRef>
                    <Ref>XXXXXX</Ref>
                </RltdRef>
                <ReqHdlg>
                    <StsCd>ACKT</StsCd>
                    <Desc>CR50</Desc>
                </ReqHdlg>
            </Rpt>
            <SplmtryData>
                <Envlp>
                    <FromBOData>TOTO</FromBOData>
                </Envlp>
            </SplmtryData>
        </RctAck>
    </Document>
</Body>

Could you please help us to fix the issue?

Thanks,

Customizable indentation

AbstractMX.message() ends up calling MxWriteImpl.write() which in turn makes use of XmlEventWriter.

XmlEventWriter always indents by 4 spaces (hard-coded). This is really undesirable due the size restriction of MX messages (100000 characters in our case - don't know if that limit comes from Swift or the messaging software we are using).

Please make this behaviour configurable via MxWriteParams / MxWriteConfiguration or use the indendation settings of the Marshaller used by MxWriteImpl.write() / BusinessAppHdrV02.xml() and so on.

The first option would be better since there is also no easy way to override Marshaller settings in Prowide.

Issue while Parsing MxPacs00800103 (XML namespace without identifier in "any" field of Signature Envolope)

I am facing issue while parsing AppHdr (BusinessAppHdrV01), specifically Sgntr (SignatureEnvelope).

In SignatureEnvelope there's a field "any" which is annotated by @XmlAnyElement.

My Xml string has a custom tag "XmlSgntr". So while parsing xml string, this "any" field is set as my custom tag. This is fine. But the problem is when my custom tag has XML namespace (xmlns), then it won't set. That is "any" field is set to null. This happens only when I set xmlns="https://acb/chjhj", but everything works fine when i set it as xmlns:xsi="https://acb/chjhj". i.e issue only exists when I set xml namespace without identifier (when xmlns value is URI).

What the reason behind this behaviour?

Edit:
So I debugged, and found another finding. This only happens if use xmlns="https://acb/chihj". If change it to xmln="https://acb/chih" or maybe anything else. That is I changed "xmlns" (namespace name). Seems like "xmlns" is causing the issue.

My Header:
<AppHdr xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:head.001.001.01 head.001.001.01.xsd" xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

My Signarure:
<XMLSgntrs xmlns="http://www.w3.org/2000/09/xmldsig#">

Non-static getters for static fields on children of com.prowidesoftware.swift.model.mx.AbstractMX

Taking as example the class com.prowidesoftware.swift.model.mx.MxPacs00800108, I see getters like
public int getFunctionality()
public int getVariant()
public int getVersion()
among others. These refer to static fields, so in my view the getters should also be declared static.

I have faced problems while trying to serialize instances of these classes as JSON with Jackson, because the non-static getters make the static fields appear as properties, so they get serialized into the JSON object, hence including elements such as "functionality", "variant", "version" that do not belong to the model.

The issue seems to affect most of the inheritors of AbstractMX, possibly also present in other packages.

JSON and XML Validation

I do understand that content validation is not performed based on your documentation, not to mention that unknown elements are simply dropped.

Is it possible to add validation so that if for instance, JSON or XML is parsed that contains elements that do not match the given message type and version, that a suitable error can be thrown?

For instance, a JSON ISO-20022 message whereby the field names started with capital letters was not thrown out, but the fields simply thrown away. It would be beneficial that when invalid data is sent, that a suitable error is thrown back so that integrators can assess and correct the error. This will ensure that good structured data is sent and that errors are not swept under the carpet.

Remove XMLGregorianCalendar in favor of java.time.*

XMLGregorianCalendar is a pain to use and nowadays, it is much more common to bind JAXB classes to some type of java.time.* variant.

For example, including this in the JAXB code generation:

<jxb:bindings version="2.0"
        xmlns:jxb="http://java.sun.com/xml/ns/jaxb"
        xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc"
        jxb:extensionBindingPrefixes="xjc"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <jxb:globalBindings>
      <xjc:javaType name="java.time.OffsetDateTime" xmlType="xs:dateTime"
          adapter="io.github.threetenjaxb.core.OffsetDateTimeXmlAdapter"/>
      <xjc:javaType name="java.time.LocalDate" xmlType="xs:date"
          adapter="io.github.threetenjaxb.core.LocalDateXmlAdapter"/>
    </jxb:globalBindings>
</jxb:bindings>

Is there any reason the JAXB generation is not included in the source code so that others could manipulate the generated code as well (for example, to add in a builder pattern, etc.)?

We are not able to find mx parser classes in the updated version but was working in SRU2021-9.2.3

We are looking for SRU2023 datetime path changes, so need to upgrade the version as we need to parse files though "seev.031.002.13".
Changes suggested in path is like /Document/CorpActnNtfctn/CorpActnDtls/DtDtls/FctvDt/Dt for message type CANO
/Document/CorpActnNtfctn/CorpActnDtls/DtDtls/LtryDt/Dt and lot many more.

For this which version we can use for implementing above changes?
as currently we are using below implementation through gradle
implementation group: 'com.prowidesoftware', name: 'pw-iso20022', version: 'SRU2021-9.2.3'.

Error in Parsing admi.004.001.01

In admi.001.001.01 there's a xml tag "SysEvtNtfnV01", but theres no suppor for this in the library. I could only found SystemEventNotificatioV02 class not V01 class. Is there are any other way to parse tag.

caaa version upgrade

Using 9.2.8, caaa 001, 002, 003, etc only has up to version 8 whereby v11 is already available. Can you please update to include the later versions of all caaa messages?

CAMT.106.001.02 not found

I'm not able to find MxCamt10600102 on SRU2023-10.1.4, do you guys have any plans to add it on the next update ?

Thanks, this library helped me a lot

Characters transformed into unicode decimal codes during initialization of MxSwiftMessage

When initializing MxSwiftMessage using MxSeev04500102, MxSeev04800101 some characters get replaced by unicode decimal codes in the following format: &#1234 (and a ";")

Example:
The field: MxSeev04800101 - ShrhldrIdDsclsrRspnCxlAdvc - IssrDsclsrReqRef - FinInstrmId - Desc
In the string: new MxSwiftMessage(mxSeev04800101).getMessage();
The character "ö" gets replaced by &#246 (and a ";")

The same happens when trying to call MxSeev04800101.message()

  • Edited because github replaces the codes with the characters.

JAXB Upgrade Plan

Hello,

Is there a plan or roadmap to upgrading the JAXB version to Jakarta XML Binding 3.0/4.0+? We have another dependency on it via an internal project, which as a result also needs to be kept at the same JAXB version, so we were looking into upgrading it across the board if possible.

Thanks!

MX Xml Parsing taking too much time

Hi,
We are working to parse swift MX message of type seev.031.002.09
When we are calling the below function. It is taking 300ms to 600 ms for parsing different XML messages.
MxSeev03100209 mx = MxSeev03100209.parse(xmlMessage);

[INFO ] 2021-04-21 21:46:01,612 Parser.mxParse() -Parsing started
[INFO ] 2021-04-21 21:46:02,010 Parser.mxParse() -Parsing end

I attached sample XML messages for which it is taking this much time. Please check why it's taking so much time as we have to process thousands of messages in a single day and it's taking hours to process.
MX_Sample_Xml_2.txt
MX_Sample_xml_1.txt

JSON serialization to lowercase names?

Is there a way to coerce these to use uppercase names?

For example, at the top level of a setr.010.001.04 message, instead of getting something like

{ "SbcptOrdr": {...

we get this:

{ "sbcptOrdr": {...

and so on for every key in the JSON output when calling .toJson().

Fix CDATA in serializer

La clase a modificar es com.prowidesoftware.swift.model.mx.XmlEventWriter

Esta clase cuando imprime el contenido final de un element tiene una rutina de escápelo custom
private String escape(char[] arr)

Tenes que modificar la logica para detectar cuando el writer entra en un CDATA, y todo eso propagarlo tal cual sin escapear hasta que termina el CDATA.

La salida del writer este debiera generar lo mismo que el XML que se le pasa de input.

Date and time formats in ISO-20022 JSON

Is there a reason why the date and times are represented in JSON in different fields instead of using the OpenAPI date time format?
eg: yyyy-MM-ddTHH:mm:ss+zz:zz

eg: 2023-07-12T15:22:53+00:00

Calling setAny() on SupplementaryDataEnvelope1

We are trying to build a camt.998 message.
Is there a good sample on how to call setAny() on the com.prowidesoftware.swift.model.mx.dic.SupplementaryDataEnvelope1 class?
It takes an Object, and during the marshaling step it will throw an exception like this (if the type is a LinkedHashMap, for example):

[com.sun.istack.SAXException2: javax.xml.bind.JAXBException: class java.util.LinkedHashMap nor any of its super class is known to this context.
javax.xml.bind.JAXBException: class java.util.LinkedHashMap nor any of its super class is known to this context.]

It seems this type is annotated as XmlAnyElement are there any good code samples on using this in Prowide?

localized line feeds

In the XmlEventWriter#writeIndentIfNeeded instead of \n use the local line feed (ex \r\n in Windows)
Check what the jaxb default writer does

Error: java.lang.NoClassDefFoundError

Hello,

I'm having problems running an application in an approval environment,
I'm using a pw-swift-core/SRU2021-9.2.13 library,

Dependencies installed in pom.xml

org.apache.commons commons-lang3 3.12.0 com.google.code.gson gson 2.8.9 com.prowidesoftware pw-swift-core SRU2021-9.2.13 the error below is occurring please help.

Caused by: java.lang.NoClassDefFoundError: com.prowidesoftware.swift.model.field.Field
at java.lang.J9VMInternals.prepareClassImpl(Native Method)
at java.lang.J9VMInternals.prepare(J9VMInternals.java:302)
at java.lang.Class.getDeclaredMethods(Class.java:975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnot
ationBeanPostProcessor.java:247)
... 12 more
Caused by: java.lang.ClassNotFoundException: com.prowidesoftware.swift.model.field.Field
at java.net.URLClassLoader.findClass(URLClassLoader.java:610)
at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:925)
at java.lang.ClassLoader.loadClass(ClassLoader.java:870)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:343)
at java.lang.ClassLoader.loadClass(ClassLoader.java:853)
... 19 more

exit 1

Parsing issue with MX message of type seev.031.002.09

Hi-
We are working to parse swift mx message of type seev.031.002.09
But, when we try to parse message using class MxSeev03100209 or AbstractMX or XMLParser parse method
we are getting exception and not able to parse xml data.
Attached is a file containing xml data we are working to parse.

Could you please assist on how to we can parse given xml data if possible could you send sample?
ABC_CANO.CA.ID.111111111.txt

fromJson fails AbstractMXAdapter

El fromJson falla cuando el JSON tiene un appHdr, porque no puede resolver la interface:

Unable to invoke no-args constructor for interface com.prowidesoftware.swift.model.mx.AppHdr. Registering an InstanceCreator with Gson for this type may fix this problem.

El adapter esta en AbstractMXAdapter

Hay que detectar el tipo de header y usar la class correspondiente. Tal vez sea necesario al serializar guardar el header type, para lo cual se puede usr el enum AppHdrType

Ver failing test en AbstractMxJsonTest#testMessageWithAppHdr. branch issue/3

Parsing issue with MX message of type xsys.003.001.01

My issue sounds similar to #39 but is about the xsys.003.001.01 message type.

The ThirdPartyRefusalReason element is of type SwAny but when I try to parse a message with a 4 character string in that element, for example:
<Sw:ThirdPartyRefusalReason>ABCD</Sw:ThirdPartyRefusalReason>
then SwAny.any is null.

JSon serialization exception: Unable to make public com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl() accessible: module java.xml does not "exports com.sun.org.apache.xerces.internal.jaxp.datatype" to unnamed module

Hello.

We are encountering the following difficulty processing ISO 20022 messages with dates on them.

Considering this sese.024.001.10 message:

<?xml version="1.0" encoding="UTF-8"?>
<DataPDU xmlns="urn:swift:saa:xsd:saa.2.0">
	<Body>                 
		<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01">                         
			<Fr>                                 
				<FIId>                                         
					<FinInstnId>                                                 
						<BICFI>DCVBCOBOXXX</BICFI> <!--BIC de la entidad que envía el mensaje-->
						<Othr>                                                         
							<Id>DCVBCOBOXXX</Id> <!--BIC del DCV-->
						</Othr>                                         
					</FinInstnId>                                 
				</FIId>                         
			</Fr>                         
			<To>                                 
				<FIId>                                         
					<FinInstnId>                                                 
						<BICFI>IMF1COBOXXX</BICFI> <!--BIC de la entidad que recibe el mensaje-->
						<Othr>                                                         
							<Id>DCVBCOBOXXX</Id> <!--BIC del DCV-->
						</Othr>                                         
					</FinInstnId>                                 
				</FIId>                         
			</To>                         
			<BizMsgIdr>20200818X0000121</BizMsgIdr> <!--ID del mensaje-->
			<MsgDefIdr>sese.024.001.10</MsgDefIdr> <!--Tipo de mensaje enviado-->
			<CreDt><!--2020-08-18T09:08:30Z--></CreDt> <!--Fecha y hora de creación del mensaje-->
		</AppHdr>                 
		<Document xmlns="urn:iso:std:iso:20022:tech:xsd:sese.024.001.10">                         
			<SctiesSttlmTxStsAdvc>                                 
				<TxId>
					<AcctOwnrTxId>115</AcctOwnrTxId><!--Referencia de transacción informada en el tag TxId del mensaje sese.023-->
					<AcctSvcrTxId>20200818T00052360</AcctSvcrTxId><!--Referencia única de la transacción en el DCV-->
				</TxId>
				<MtchgSts>
					<Mtchd>MACH</Mtchd><!--Indicador de que la transacción se encuentra emparejada-->
				</MtchgSts>
				<TxDtls>
					<TradDt>
						<Dt>
							<DtTm>2020-08-18T08:01:30</DtTm><!--Fecha y hora de negociación informada en el mensaje sese.023-->
						</Dt>
					</TradDt>
				</TxDtls>
			</SctiesSttlmTxStsAdvc>                 
		</Document>         
	</Body>
</DataPDU>

We try to make a JSon object out of it using Prowide this way:

MxSese02400110 prowideFuncional=MxSese02400110.parse(message);
System.out.println(prowideFuncional.toJson());

But every time the toJson() method is called, we get a the exception Unable to make public com.sun.org.apache.xerces.internal.jaxp.datatype.XMLGregorianCalendarImpl() accessible: module java.xml does not "exports com.sun.org.apache.xerces.internal.jaxp.datatype" to unnamed module

And this only happens when the XML has any dates on it.

If i remove them, the Exception goes away.

Can you help me with this?

Create pdu data

Dear Mr Zubri
i have created an mx message but i am having difficulty creating the external part, which is DataPDU and header tag. like i can create from tag and below, i mean the body tag but for the above part, i don't know which class i should include to take an object from it and create the rest of the message as i did in the remaining part

this is my missing part

?xml version="1.0"?>
<ns:DataPDU
xmlns:ns="urn:swift:saa:xsd:saa.2.0">
ns:Header
ns:Message
ns:SenderReferenceMXWebM522237</ns:SenderReference>
ns:MessageIdentifiercamt.029.001.01</ns:MessageIdentifier>
ns:FormatAnyXML</ns:Format>
ns:SubFormatInput</ns:SubFormat>
ns:Sender
ns:DNo=ptsausaa,o=swift</ns:DN>
ns:FullName
ns:X1PTSAUSAAXXX</ns:X1>
</ns:FullName>
</ns:Sender>
ns:Receiver
ns:DNo=ptsausaa,o=swift</ns:DN>
ns:FullName
ns:X1PTSAUSAAXXX</ns:X1>
</ns:FullName>
</ns:Receiver>
ns:InterfaceInfo
ns:UserReferenceMXWebM522237</ns:UserReference>
</ns:InterfaceInfo>
ns:NetworkInfo
ns:IsNotificationRequestedtrue</ns:IsNotificationRequested>
ns:Serviceswift.generic.ia!x</ns:Service>
</ns:NetworkInfo>
</ns:Message>
</ns:Header>

Enhance XML writer

-----------extraneous space-------------------------------------
Doc:PricDtls
Doc:GncCshPricRcvdPerPdct
Doc:AmtPric
Doc:AmtPricTpACTU</Doc:AmtPricTp>
<Doc:PricVal Ccy="PLN" >5.00</Doc:PricVal>
</Doc:AmtPric>
</Doc:GncCshPricRcvdPerPdct>
</Doc:PricDtls>

-----------missing line separator Doc:AddtlTxt -------------------------------------
Doc:AddtlInf
Doc:AddtlTxt
Doc:AddtlInfResNbAndDt//600/15, 2018-12-19</Doc:AddtlInf>
Doc:AddtlInfIssuerNm//XXXSA</Doc:AddtlInf>
Doc:AddtlInfIssuerAdr//UL. XXXX 3495 Lok. 55562, 01-234 BBB</Doc:AddtlInf>
</Doc:AddtlTxt></Doc:AddtlInf>

-----------missing line separator date-------------------------------------
Doc:CorpActnDtls
Doc:DtDtls
Doc:RcrdDt
Doc:Dt
Doc:Dt2018-12-17</Doc:Dt></Doc:Dt>
</Doc:RcrdDt>
Doc:ThrdPtyDdln
Doc:Dt
Doc:Dt2018-12-17</Doc:Dt></Doc:Dt>
</Doc:ThrdPtyDdln>
</Doc:DtDtls>
Doc:ChngTp
Doc:CdDEPH</Doc:Cd>
</Doc:ChngTp>
</Doc:CorpActnDtls>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.