return (Document) domResult.getNode();
}
private MethodCallMessage parseMethodCall(Document input) throws JAXBException {
MethodCallMessage request = unmarshaller.unmarshal(input, MethodCallMessage.class).getValue();
MethodCall result = request.getMethodCall();
List<String> classNames = result.getClasses();
Class<?>[] clazzes = new Class<?>[classNames.size()];
ClassLoader cl = this.getClass().getClassLoader();
for (int i = 0; i < classNames.size(); i++) {
try {
clazzes[i] = cl.loadClass(classNames.get(i));
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
JAXBContext jaxbContext = JAXBContext.newInstance(clazzes);
Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
Object[] args = result.getArgs();
for (int i = 0; i < args.length; i++) {
args[i] = unmarshaller.unmarshal((Node) args[i], clazzes[i]).getValue();
}
return request;
}