Updated Java Web Services Message Client Redux now available.
Most of the Java web services examples on the web use an RPC-style interface. That’s fine when you’re calling a web service implemented in Java. But web services being what they are, you’ll eventually find yourself invoking a message-style web service whose WSDL gives wsdl2java fits.
When that time comes, you can either roll your own code rather than use wsdl2java or you can go with the flow with a message-style interface. I think that you’ll find it easier to go with the message-style interface. And to make it even easier, here is a simple message-style client to get you started.
This client reads an input document from standard input, invokes a web service, and then prints the web service response. The results shown here use Java 1.4.2_11 and Axis 1.3.
And here is the client in action, calling the echoString operation of the echo web service example included in the Axis distribution. The actual response body is a single line, I have taken the liberty of formatting the response for easier reading.