Created
January 28, 2014 13:39
-
-
Save esaounkine/8667807 to your computer and use it in GitHub Desktop.
code snippet to parse XML string into a valid MX message object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public Message parseMessage(String msgText) throws Exception { | |
String namespace = msgText.replaceAll("(?s).*?xmlns=\"(.*?)\".*", "$1"); | |
return CoreMessage.parseXML(msgText, namespace); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment