Announcement Announcement Module
Collapse
No announcement yet.
Adding JAXB2 support for SOAP header elements Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding JAXB2 support for SOAP header elements

    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

  • #2
    Originally posted by Joris Kuipers View Post
    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?
    I would like this feature also.

    Currently I have worked my way around the challenge by creating an interceptor that unmarshals my header element and puts it as an attribute on the context. I need this particular header on all my requests. From there other beans can access it in the request scope, including the endpoint. This works, but a nicer way of doing it would be most welcome.

    If there is a JIRA issue I can vote for, please post the link

    Regards
    Flemming J´┐Żnsson

    Comment

    Working...
    X