List<Object> filters =
Arrays
.asList(new Object[]{ XmlDecoderFilter.class, XmlMethodCallMarshalFilter.class, requestMapperFilter, });
filterChainFactory.setFilters(filters);
FilterAction filterChain = filterChainFactory.create();
MethodCall methodCall = new MethodCall("test", new Object[]{ "foo" }, Arrays.asList(String.class.getName()));
MethodCallMessage request = new MethodCallMessage(methodCall, "bar");
JAXBContext jaxbContext = JAXBContext.newInstance(MethodCallMessage.class, MethodResultMessage.class);
final Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
final Marshaller marshaller = jaxbContext.createMarshaller();
DOMResult domResult = new DOMResult();
marshaller.marshal(new JAXBElement<MethodCallMessage>(new QName(MethodCallMessage.class.getSimpleName()),
MethodCallMessage.class, request), domResult);
String input = XmlDecoderFilter.writeDocument(domResult.getNode());
String result = (String) filterChain.filter(input, new HashMap<String, Object>());
Document parseDocument = XmlDecoderFilter.parseDocument(result);
MethodResultMessage value = unmarshaller.unmarshal(parseDocument, MethodResultMessage.class).getValue();
String value2 = unmarshaller.unmarshal((Node) value.getResult().getArg(), String.class).getValue();
value.getResult().setArg(value2);