Aug 5th, 2007, 02:32 PM
Improving the spring-ws client
I have been tracking spring-ws for a while and I am beginning to use it pretty extensively. One thing that keeps coming up is that the web-service client support (imho) could use some improvement. I wanted to float the idea of trying to refactor the client package to be less complicated, more capable, and easier to use. I've got an idea for how to do that and, with Arjen's permission, I would like to submit it as a contribution.
As an intellectual exercise for myself I have already done a good portion of the refactoring work. But before I submit it or do any more work I wanted to get a feeling for what other people thought. Is this something that would be valuable?
Aug 6th, 2007, 03:54 AM
Well, if you have a good idea, I'm certainly open to it. But since we're really to close to 1.0, I cannot change too much.
Aug 7th, 2007, 10:32 PM
Do you have a preference on how I submit it? Should I create a branch and commit it into subversion or would you prefer I upload a zip file somewhere? Its going to be 10-20 files including unit tests.
Aug 8th, 2007, 02:28 AM
The best thing to do is to create a JIRA issue, and attach the code to it.
Could you also give a brief explanation as to what the improvements are?
Aug 8th, 2007, 10:12 AM
Ok. I'll do that.
There are two main improvements. The first is an approach to solving SWS-148. The rest are what I would consider structural improvements. I'll see if I can explain the strucutral approach.
There are two base interfaces, WebServiceClient and WebServiceClientFactory. As one might imagine, the factory creates the clients. The WebServiceClient interface has two methods for sending WebServiceMessages. Extending these two interfaces are two more interfaces: MarshallingWebServiceClient and MarshallingWebServiceClientFactory. Same pattern, but adding marshalling-related methods.
There are four implementation classes which realize all of the interfaces described above: BaseWebServiceClient, BaseWebServiceClientFactory, OxmMarshallingWebServiceClient, and OxmMarshallingWebServiceClientFactory. The BaseWebServiceClient supports the use of multiple WebServiceInterceptors. The WebServiceInterceptor interface supports two methods which allow full access to the message before it is sent and after it is received.
Clear as mud?
Aug 8th, 2007, 10:17 AM
I should add, my expectation was that people using these classes would inject one of the factory implementations into their code. They would then be able to create as many clients as their runtime operations needed. This was one of the other main improvements. I was trying to account for the scenario where the application does not know what endpoint it will be talking before runtime.
Aug 8th, 2007, 11:14 PM
Aug 9th, 2007, 02:28 AM
Thanks for the code. It looks interesting!
Unfortunately, we are too far in the 1.0 release cycle to add this new feature now. We will probable add it in the post 1.0 timeframe, either in a minor update (1.0.x), or - more likely - 1.1.
Remember, if you want to see this functionality in SWS as soon as possible, vote for the issue!
Nov 1st, 2007, 02:34 PM
Do these proposed changes include support for multiple marshallers? The problem I'm running into is I need to have multiple marshallers/adapters on the server (which it does) but I cannot replicate that on the client. Until then I have to shove 30! objects into the same package.
Last edited by mmccaskill; Nov 4th, 2007 at 02:17 PM.
Nov 3rd, 2007, 11:39 AM
Yes, this will probably include the possibility of multiple marshallers.