Web services with Axis2 however pose a limitation of passing the user defined objects (or some predefined apis - ResultSet for example) through. The starting up solution is to pile everything on the HashMap and retrieve the required information. If not, Axis2 provides for serialization of your class to flatten it to pass through and get accepted.
Vinod K Singh
Joined: Sep 30, 2008
It is not just with Axis, all kind of web services have limitations. They work well with primitives (including String), arrays of primitives, objects which contain primitives and/or their arrays and arrays of such objects. For everything else there is no straightforward way and they are not portable as well.
For situations where you have control over both sides of the wire, and where no other clients need to be supported, I wouldn't recommend web services. Their overhead is real, and it wouldn't really pay off in this situation.
If the JVM version is the same on both sides, you could serialize the object over an HTTP connection. Or omit HTTP altogether, and serialize them over a Socket connection.
Or, more cross-platform and cross-version compatible, use an HTTP POST where the parameters are the keys and values of the Map as strings. That wouldn't work so well if the objects are structured, though (as opposed to being more or less primitives than can easily be converted to/from strings).
I gave a look to Google App Engine's URLFetch API, which can be used for the web service invocation and HTTP POST or HTTPS POST for that matter. Is there any pre-existing APIs available coded specifically for (read 'in') Java?