I have an existing WSDL that contains a custom SOAP header as part of the request message. I'm using JAXB2 to map the corresponding XSD to Java classes, and a class for that header element is created as expected. However, it looks like Spring-WS doesn't provide a convenient way to pass the unmarshalled header as a method parameter to my annotation-based endpoint method (I need access to the element in the endpoint method itself).
SoapHeaderElementMethodArgumentResolver currently only supports parameters of type SoapHeaderElement or Lists thereof. I looked at extending it to add support for JAXB2, but the code that currently adds supports for @RequestPayload-based unmarshalled JABX2 parameters - mostly in AbstractJaxb2PayloadMethodProcessor - is not easily reusable as it's specific to payload-based parameter handling.
I can work around the issue some way for now, but to properly support this I guess the JAXB2 support should be extracted to not be tied to payload handling. What does the dev team think? Should I create a JIRA improvement request for this, perhaps, or am I overlooking some existing feature that can easily provide me with an unmarshalled header element?
Thanks,
Joris


Reply With Quote

