SoapHeaderElementMethodArgumentResolver implements MethodArgumentResolver { @Override public boolean supportsParameter(MethodParameter parameter) { SoapHeader soapHeader = parameter.getParameterAnnotation(SoapHeader.class); if (soapHeader == null) { return false; } Class<?> parameterType = parameter.getParameterType(); if (SoapHeaderElement.class.equals(parameterType)) { return true; } if (List.class.equals(parameterType)) { Type genericType = parameter.getGenericParameterType(); if (genericType instanceof ParameterizedType) { ParameterizedType parameterizedType = (ParameterizedType) genericType; Type[] typeArguments = parameterizedType.getActualTypeArguments(); if (typeArguments.length == 1 && SoapHeaderElement.class.equals(typeArguments[0])) { return true; } } } return false; }  @Override boolean supportsParameter(MethodParameter parameter); @Override Object resolveArgument(MessageContext messageContext, MethodParameter parameter);  }
@Test public void supportsParameter() throws Exception { assertTrue("resolver does not support soapHeaderElement", resolver.supportsParameter(soapHeaderElementParameter)); assertTrue("resolver does not support List<soapHeaderElement>", resolver.supportsParameter(soapHeaderElementListParameter)); }