You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Bas A. Schulte" <ba...@gmail.com> on 2006/01/25 02:23:13 UTC

How does java2wsdl work?

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.


Re: How does java2wsdl work?

Posted by "Bas A. Schulte" <ba...@gmail.com>.
On Jan 25, 2006, at 2:32 PM, Dies Koper wrote:

> If your class follows the Javabean conventions (public getter and  
> setter), Axis will pick up that field and include it in the WSDL.
> Otherwise the field needs to be public.
> Check out the Java->XML mapping section in the JAX-RPC 1.1 spec for  
> details.

Right, I figured this was a jax-rpc issue, just wondered about it.


Re: How does java2wsdl work?

Posted by Dies Koper <di...@jp.fujitsu.com>.
Hi Bas,

If your class follows the Javabean conventions (public getter and 
setter), Axis will pick up that field and include it in the WSDL.
Otherwise the field needs to be public.
Check out the Java->XML mapping section in the JAX-RPC 1.1 spec for details.

Regards,
Dies


Bas A. Schulte 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.
> 
> 

-- 
Dies KOPER <di...@jp.fujitsu.com> (changed on 1 July 2005)
Fujitsu Ltd - MWPF1  (changed from MWPF3 on 21 Nov 2005)
2-15-16, Shin-Yokohama, Kouhoku-ku, Yokohama, 222-0033, Japan
Tel. +81(45)-475-5605  (internal 7181-4217)


Re: How does java2wsdl work?

Posted by "Bas A. Schulte" <ba...@gmail.com>.
On Jan 25, 2006, at 2:53 PM, Anne Thomas Manes wrote:

> 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

I have a SOAP billing engine that amonst others receives SOAP  
requests from another java application. It also receives SOAP  
requests from applications in other languages, it also handles some  
services through REST and raw XML-over-HTTP-POST

Had I been interested in adding RMI or CORBA into the mix, then I  
would have used that.

SOAP will handle the requirements fine, thank you.


Re: How does java2wsdl work?

Posted by Anne Thomas Manes <at...@gmail.com>.
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 <ba...@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.
>
>