New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unified access to headers for WebServiceConnections [SWS-894] #972
Comments
Greg Turnquist commented
Care to share examples here of HTTP and JMS checks you have in place to retrieve the headers? |
Marten Deinum commented I'm not at liberty to post any actual code but the code looks somewhat like the following...
The check for |
Greg Turnquist commented Thanks. I'll see what I can do. |
Marten Deinum commented Looking closer at the API there is already something like that in the super class For me that is enough... |
Marten Deinum commented The API is protected however, not sure what would break if that would be made |
Greg Turnquist commented I was aware of that, which is why I wanted to see your use case in more detail. There is the ability to find headers, but in some cases, they are request headers. In other concrete implementations, they are response headers. I don't see widening visibility as an issue for backwards compatibility. If those methods appear to serve your needs and are visible through both JMS and HTTP variants, it might be possible to extract a common interface. |
Greg Turnquist commented I've prototyped making the APIs public instead of protected. Check out https://github.com/spring-projects/spring-ws/commits/SWS-894, specifically 73a3edb. So far, it doesn't break any test cases. I am trying to evaluate the original context of why they were made protected to see if the reason still applies or not. |
Arjen Poutsma commented They were protected because they didn't need to be public (or at least: not until now). The less you expose, the less you have to keep backward compatible :). Even though the |
Arjen Poutsma commented I would also expose the response headers by making |
Greg Turnquist commented I cleaned up that branch with said changes. Seeing that there is also an AbstractSenderConnection class with symmetrical properties, I created a similar interface for the other side and made similar adjustments. |
Greg Turnquist commented Pull request has been fashioned here => #32 I'll let this simmer before merging. |
Greg Turnquist commented Fixed via 4b179e8 |
Marten Deinum opened SWS-894 and commented
Currently when needing access to headers one needs to check the type of the
WebServicConnection
retrieve theHttpServletRequest
and callgetHeader
on the resulting object.We use both HTTP and JMS in our application and some of our interceptors are containing if statements to determine if it is HTTP or JMS and retrieve the headers appropriatly.
Would be nice if a unified interface
HeadersAwareWebServiceConnection
comes to mind. This interface would then have agetHeader
method to retrieve the header. Maybe some additional methods likeheaderNames
orcontainsHeader
might be useful as well.This would probably be useful for both HTTP flavors and JMS implementation of the
WebServiceConnection
.Affects: 2.2.1
The text was updated successfully, but these errors were encountered: