amonroy has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

I have been reading about SOAP::Lite and I've decided I want to implement my SOAP server with a perl backend, because it's my favorite language. Nevertheless, I know there will be clients coded in Java.

I searched about using Java as a client and I found this posting, but no encouraging responses.

So, basically, I just want to know if it's possible to do something like this in Java or if someone has done something similar. Otherwise, what's the point of using the Simple Object Access Protocol if you cannot pass objects from one language to another!

use SOAP::Lite +autodispatch => uri => 'http://my.server.com/My/Class', proxy => 'http://my.server.com/soap'; my $o = My::Class->new('bar'); print $o->method('drink');

Thanks,

--
Andrés Monroy

Replies are listed 'Best First'.
Re: Backend with SOAP::Lite and Java as a client
by exussum0 (Vicar) on Jul 19, 2004 at 10:44 UTC
    The short answer is, you can. The longer answer is, you sorta can. Java and soap have conventions to declare what a variable is. Most of the simple types map. int to int, string to string and so on. Just beware one thing: complex/custom serialized types. If you keep the types simple it's rather easy. Check the documentation for your soap libraries and the standard, to see how they map the types.

    Apache axis for instance, tells you which standards the follow and which ones they extend upon for convenience.

    Bart: God, Schmod. I want my monkey-man.

Re: Backend with SOAP::Lite and Java as a client
by perrin (Chancellor) on Jul 19, 2004 at 11:35 UTC
    One thing you should be aware of is that SOAP is not for objects. When you see people doing things involving new() and calling methods on the returned object, they are faking it with various annoying workarounds. That's just a limitation of SOAP, not a Java problem.
Re: Backend with SOAP::Lite and Java as a client
by pg (Canon) on Jul 19, 2004 at 13:39 UTC

    The question bears the same merit as if you asked whether you can send a TCP packet from a problem written in language A to another program written in language B. The answer has to be yes, otherwise why we have all those standards.

    In the case of TCP packet, the issue is how to pack and unpack the packet (to interpret it) on both side. Here the same. The precise answer is that, yes, as long as, both side interpret the SOAP packet correctly, following the same definition.