JaxbElementPayloadMethodProcessor extends AbstractJaxb2PayloadMethodProcessor { @Override public JAXBElement<?> resolveArgument(MessageContext messageContext, MethodParameter parameter) throws JAXBException { ParameterizedType parameterizedType = (ParameterizedType) parameter.getGenericParameterType(); Class<?> clazz = (Class<?>) parameterizedType.getActualTypeArguments()[0]; return unmarshalElementFromRequestPayload(messageContext, clazz); }  @Override JAXBElement<?> resolveArgument(MessageContext messageContext, MethodParameter parameter);  }
@Test public void resolveArgument() throws JAXBException { WebServiceMessage request = new MockWebServiceMessage( "<myType xmlns='http: MessageContext messageContext = new DefaultMessageContext(request, new MockWebServiceMessageFactory()); JAXBElement<?> result = processor.resolveArgument(messageContext, supportedParameter); assertTrue("result not a MyType", result.getValue() instanceof MyType); MyType type = (MyType) result.getValue(); assertEquals("invalid result", "Foo", type.getString()); }