Re: [soaplite] Perl client to Java web service
- On Mon, 12 Jan 2004, Jason wrote:
> So far I've been able to access the service fine, the problem is whenYou could use complex types representing java objects, but it would make
> one of my methods on the service requires a complex Java class as a
> paramater. I have no idea how to go about passing something like that
> via SOAP. Can someone point me to a tutorial, or even better, perhaps
> show me what the SOAP request would look like? I'll include a very
> simple Java class. If I could just see one good example of a Java
> class represented in SOAP, using complex object types, I could figure
> out my problem.
SOAP clients a lot less simple to write in any non-Java language. It would
also defeat the purpose of SOAP - S is supposed to stand for Simple. If
you want to pass java objects around then use RMI and CORBA - thats what
they were made for.
Of course you could always assume that people might not use java and so
design a web interface that is transparent - take arguments, and construct
the java object you want yourself rather than expecting the client to do
The best solution would be to design a simple XML representation of what
you want, and parse that into a new java object inside your webservice -
you shouldn't expect client programmers to do your job for you ;) Then if
you really want to make your webservice professional you could provide a
WDSL so that client programmers can (in theory at least) built clients
quickly without having to delve too much into complex data structures.
If you want to build complex data (rather than complex data types) in SOAP
see the <plug>SOAP::Data::Builder</plug> perl module, which should make
your life easier.
Hope that helps,
Aaron J Trevena - Perl Hacker, Kung Fu Geek, Internet Consultant
AutoDia --- Automatic UML and HTML Specifications from Perl, C++
and Any Datasource with a Handler. http://droogs.org/autodia