Created
January 5, 2017 11:20
-
-
Save akkida746/c83b4be51ee385e6f8ef2a2b5f82fbd3 to your computer and use it in GitHub Desktop.
Marshall Object to XML java
This file contains hidden or 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 static Order getOrder(String orderxml) throws GdiSomException | |
{ | |
try { | |
JAXBContext jaxbContext; | |
jaxbContext = JAXBContext.newInstance(Order.class); | |
Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller(); | |
StringReader reader = new StringReader(orderxml); | |
Order order= (Order) jaxbUnmarshaller.unmarshal(reader); | |
return order; | |
} catch (JAXBException e) { | |
throw new GdiSomException(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment