Currently, the services will use Servlets. (through this Framework)..but, later, the Servlets would be replaced by web services. But, the Swing Client will use the Framework so that we do not need to change many classes. Framework will protect the client. Can someone suggest me such a framework?
What does the servlet return now - XML? Then you could argue that it is a service already. If not then you may want to standardize now on an URL scheme that you can use unchanged later when you switch to REST-style services, and on a response format you can use now and later (most likely XML or JSON).
Serialized objects are a Java-only technology, which goes against the spirit of web services. If your objects are JavaBeans you could use java.beans.XMLEncoder/Decoder for serialization. That would give you a shot at cross-platform compatibility and might still be usable in a more WS-style architecture.
The benefit is that if your objects can be represented as JavaBeans, then you get the (de)serialization for free. I'm not sure how well that works with more complicated objects (like nested arrays and collections), but it's easy to try and see what those classes create from those.
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.