Skip to content
Discussion options

You must be logged in to vote

A workaround would be to present your block 4 with dummy headers when calling the toJson. Then manipulate the JSON output to discard the part corresponding to the dummy headers. Notice you just need dummy block 1 and 2 since block 3 is already optional.

https://dev.prowidesoftware.com/latest/open-source/core/mt-parser/#base64-block4-parsing

Something like this should do the trick:

 SwiftMessage sm = new SwiftMessage();
 sm.setBlock4(SwiftParser.parseBlock4("{4:" + payload + FINWriterVisitor.SWIFT_EOL + "-}"));
 sm.setBlock1(new SwiftBlock1());
 sm.setBlock2(new SwiftBlock2Input();

Where payload is the plain block 4 text without boundaries

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zubri
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants