Skip to content

Instantly share code, notes, and snippets.

@esaounkine
Created January 28, 2014 13:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esaounkine/8667807 to your computer and use it in GitHub Desktop.
Save esaounkine/8667807 to your computer and use it in GitHub Desktop.
code snippet to parse XML string into a valid MX message object
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