axis-java-user mailing list archives

If you have java at both ends there is no problem with using axis to
send your own class. You just have to go through all of the rigamarole
in defining the interface and the serializers at both ends. Once you
have got the hang of that, it is a breeze.
JWD
>>> atmanes@gmail.com 01/25/06 12:54 PM >>>
Axis is not a distributed object protocol.
Axis (or any web services framework) is not an appropriate system to use
if
your goal is to send a Java *class* over the network. Axis communicates
using SOAP. SOAP is an XML messaging protocol. Its purpose is to send
XML
messages (i.e., data) between two nodes. It does not send objects.
java2wsdl is a tool that examines the public interface of a Java class,
and
from that generates a WSDL description for the class. The WSDL
description
will contain an operation for each public method in the class, and it
will
generate an XML Schema definition of a set of data elements that
correspond
to the method parameters and return values. Any attributes or methods in
the
class that are not public will not be mapped to the WSDL.
Don't think of it as a "not nice, but workable" situation. If you want a
distributed object system for transferring objects between two Java
applications, use RMI or CORBA. The reason people use SOAP is so that
they
need to communicate with many different languages -- some of which
aren't
object-oriented (e.g., COBOL).
Anne
On 1/24/06, Bas A. Schulte <basschulte@gmail.com> wrote:
>
> Hi all,
>
> I'm trying to send an existing java class (not my app, don't have the
> source, beyond a decompiled version to see what's in it) over the
> wire using Axis on both ends, with very little success.
>
> What I'm wondering about: how does java2wsdl work in terms of
> establishing what attributes a given class has? It appears to derive
> this from the methods of the class, not by looking at the (private)
> attributes, would that be how it works?
>
> My problem is that the class has an array (boolean[]) for which there
> is no getter/setter, hence it does not show up in the wsdl. It
> doesn't get transferred over the wire and thus the instance on the
> server end doesn't have this array set properly, causing some methods
> to toss a null pointer exception :(
>
> I'll have to solve it by creating a similar class, construct one in
> the client and send that over the wire instead. Not nice, but
workable.
>
> Just can't seem to figure out how a) the wsdl gets created and b)
> serialization takes place.
>
> Cheers,
>
> Bas.
>
>