This week's giveaways are in the MongoDB and Jobs Discussion forums.
We're giving away four copies of Mongo DB Applied Patterns and 4 resume reviews from Five Year Itch and have the authors/reps on-line!
See this thread and this one for details.
The moose likes Web Services and the fly likes Automate WS Client Program Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Mongo DB Applied Patterns this week in the MongoDB forum
or a resume review from Five Year Itch in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Reply Bookmark "Automate WS Client Program" Watch "Automate WS Client Program" New topic
Author

Automate WS Client Program

Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
Hi All,

How do we automate the process of writing a web service axis client program that uses stub based approach where a web service method accepts and returns custom types. Are there any plugin for eclipse or frameworks that does that. I am using doc/lit style web service but not rpc/enc

Say below is method signature and corresponding class structures of inputs and output parameters :





Thanks & Regards,


RR Kumaran
SCJP 1.4
Ben Keeping
Greenhorn

Joined: Jan 19, 2005
Posts: 10
SOAP generally only supports primitive data types, string and base65 encoded binary data. I'm not sure SOAP is the best thing for transmitting custom data types (ie classes), because while you could serialize a class into a byte[] and then encode that as base64, and send that, how would a non-Java client understand the data ? I think for transmitting custom classes, you are much better off with using RMI, which will handle the serialization of a class for you ...


Free Java Database Connection Pooling Software<br /><a href="http://www.primrose.org.uk" target="_blank" rel="nofollow">primrose.org.uk</a>
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
I am using doc/lit style web services and the custom types schemas are included int the wsdl and hence client web service soap toolkit can use such wsdl to communicate with the web service. Under these scenarios, I want to automate the web service client program that uses the stubs generated by the client soap toolkit. Hope I am clear.
Doug Hoople
Greenhorn

Joined: Dec 29, 2004
Posts: 11
If you make the classes implement the Serializable interface, then the rest should take care of itself. There's an example of this in the Redbook Weather Service, where the user-defined datatype Weather is passed in and passed out, both in unit form and in array form. The only thing I can see enabling this is the Serializable implementation.

I know that the Redbook examples are for WebSphere, but the download does contain fully blown-out versions of their resulting services, and they're JAX-RPC (JSR 109) compliant, so they should work with the other frameworks as well.

Doug Hoople
MCSD.NET, MCDBA, MCSE, MCT, SCJP1.4
Rr Kumaran
Ranch Hand

Joined: Sep 17, 2001
Posts: 548
I am not looking for examples but are there any tools other than WSAD that automates the process of using custom types in WS Client Programs much like WSAD does when you run its wizards on WSDL ...
Doug Hoople
Greenhorn

Joined: Dec 29, 2004
Posts: 11
Hi Kumar,

What WSAD is doing under the wizard's covers is basically running Java2WSDL. So again, define your class, have it implement Serializable (as is done in the Weather example), and then run it through Java2WSDL. You should then have a usable input to all the rest of the cycle.

Doug Hoople
MCSD.NET, MCDBA, MCSE, MCT, SCJP1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Automate WS Client Program
 
Similar Threads
variable-length arguments ambiguities
Array assignment
Accessing private variable
a question about overload in subclass
References and casting