Skip to content

Instantly share code, notes, and snippets.

@esaounkine
Created March 14, 2014 08:16
Show Gist options
  • Save esaounkine/9543883 to your computer and use it in GitHub Desktop.
Save esaounkine/9543883 to your computer and use it in GitHub Desktop.
parsing and validation an MT (more examples http://wiki.datamation.gr/x/OIBH)
protected void testMessage(String messageContent) throws InvalidMessageFormatException {
//parse message string to the SwiftMessage object
SwiftMessage message = new SwiftMsgProcessor().ParseMsgStringToObject(messageContent);
//validate SwiftMessage (parsed from String or built programmatically)
SwiftMsgValidator validator = new SwiftMsgValidator();
SwiftValidObj validation = validator.validateMsg(message);
//swift mt text
String mtMessageText = validation.getMessage();
//obtain list of errors from the validation object
ValidationErrorList errorList = validation.getValidationErrorList();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment