Created
May 9, 2022 18:50
-
-
Save presci/a29a8c89ed134dc07918690635923a0c to your computer and use it in GitHub Desktop.
jaxb converter
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 static final AcctProductMapGetResT util(String str) { | |
try { | |
JAXBContext jaxbContext = JAXBContext.newInstance(AcctProductMapGetResponseT.class, | |
AcctProductMapGetResT.class); | |
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller(); | |
JAXBElement<AcctProductMapGetResponseT> jresp = unmarshaller.unmarshal( | |
new StreamSource(new ByteArrayInputStream(str.getBytes())), AcctProductMapGetResponseT.class); | |
AcctProductMapGetResponseT resp = jresp.getValue(); | |
Assert.assertNotNull(resp); | |
return resp.getResponse(); | |
} catch (Exception e) { | |
return null; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment