This is due to a patch refered in the release CHANGELOG as: Fixed MT parser to allow additional lines in a field start with colon ':'
It was necessary because it is not sufficient to check for a starting colon as new field indicator; for example for fields like 77E it is allowed the field content to have a ':<CR><LF>' as the second line.
You should use proper field names in order to be detected as new fields by the parser. Not necessary a valid field for the MT, but at least something like 0-9[0-9][A-Z]
Hello, guys.
Can you help me on this.
After updating to 7.8.5 version from 7.7 I'm having some problems with parsing MT198 file.
I have method
And a class FieldCUSTOM_TAG which extends Field class.
This is the sample text, which I'm trying to parse with 7.8.5 version.
{1:F01BIC0BANKAXXX0006222623}{2:I198BIC0BANKXXXXS}{4:
:20:my_ref
:12:1
:77E:
:21:my_ref
:13D:1611240000+0100
:32B:USD10,
:CUSTOM_TAG:my_value
-}
Here goes the code and outputs in different versions.
SwiftParser swiftParser = new SwiftParser(in);
SwiftMessage swiftMessage = swiftParser.message();
System.out.println(swiftMessage.getBlock4());
7.8.5 version Output:
com.prowidesoftware.swift.model.SwiftBlock4[[Tag[20:my_ref], Tag[12:1], Tag[77E:], Tag[21:my_ref], Tag[13D:161124], Tag[32B:USD10,
:CUSTOM_TAG:my_value]]]
7.7 version Output:
com.prowidesoftware.swift.model.SwiftBlock4[[Tag[20:my_ref], Tag[12:1], Tag[77E:], Tag[21:my_ref], Tag[13D:161124], Tag[32B:USD10,], Tag[CUSTOM_TAG:my_value]]]
The problem is that in 7.7 version my custom method getFieldCUSTOM_TAG(SwiftMessage swiftMessage) returns FieldCUSTOM_TAG.
But in 7.8.5 the field CUSTOM_TAG not found. When I try to get it with getFieldCUSTOM_TAG(SwiftMessage swiftMessage).
What I'm doing wrong? Is there any new approach of parsing in 7.8.5?
Thanks in advance.
Sorry, The topic was about Parsing MT198 not MT98.
Don't know how to edit topic.
Hi,
This is due to a patch refered in the release CHANGELOG as:
Fixed MT parser to allow additional lines in a field start with colon ':'
It was necessary because it is not sufficient to check for a starting colon as new field indicator; for example for fields like 77E it is allowed the field content to have a ':<CR><LF>' as the second line.
You should use proper field names in order to be detected as new fields by the parser. Not necessary a valid field for the MT, but at least something like 0-9[0-9][A-Z]
Also notice that you could use a custom user block to append stuff to the message in a more standard way. Check the javadoc for SwiftBlockUser at: http://api.prowidesoftware.com/core/com/prowidesoftware/swift/model/SwiftBlockUser.html
Finally, for more prompt and private assitance please check our support offering at:
http://www.prowidesoftware.com/services.jsp