prowide / prowide-iso20022

Comprehensive business model and parser for all ISO 20022 messages
https://www.prowidesoftware.com
Apache License 2.0
147 stars 68 forks source link

Cant parse ClrSysMmbId from AppHeader #12

Closed heliosnarcissus closed 3 years ago

heliosnarcissus commented 3 years ago

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?

zubri commented 3 years ago

The AppHdr is just an interface, with convenient generic methods for common use cases. To access all the information in the parsed header you have to cast that to the specific header implementation.

Check this example: https://github.com/prowide/prowide-iso20022-examples/blob/main/src/main/java/com/prowidesoftware/swift/samples/MxParseMessageWithHeader2.java