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 Michael Fecina <fe...@psu.edu> on 2002/11/10 19:24:38 UTC

what classes should be used?

Hello,

I'm working through deploying my web service.  However, there's this one problem that won't
leave me alone.

I have a folder (a package) named groceryWebService1.  Within this package, I have a folder (and hence
another package) named groceryWebService1.ws.  Note that the files within the folder groceryWebService1.ws
are essentially the same file names as those within my original package, and were created by running the WSDL2Java command.

Now that I have all these new files that seem to be interfaces with RMI stuff attached, when I actually go to write
a client that calls my service, I get an error because I'm trying something like:

(*gws is a remote interface.  it's functions searchProductList and getProductTree expect return type groceryWebService1.ws.Product and groceryWebService1.ws.ProductTree respectively*)

Product p = new Product();
p = gws.searchProductList(blah, blah);

Obviously, I get an error saying that gws.searchProductList is required to return type groceryWebService1.ws.Product, and groceryWebService1.Product is found.  Now, I know I can go through all the genreated code and change the rturn types for all the functions that need be.  However, is this necessary?  Should I be using the Product class that is created by axis, or my original Product class that has no RMI or anything of the sort?  I woudl suspect th eneed to use the one created by axis, but I can't instantiate a 'new' one since it is abstract.
The same goes for all the other supplementary classes I have (ProductTree, Node, Category, etc.).

Any information would be greatly appreciated.

Thanks,
Mike Fecina (fecina@psu.edu)

RE: Why seleton and are web service push technology?

Posted by Mike Oliver <ol...@appsaspeers.com>.
 

 

Michael Oliver

AppsAsPeers LLC

7391 S. Bullrider Ave.

Tucson, AZ 85747

Phone:(520)574-1150

Fax:(520)844-1036

 

-----Original Message-----
From: Ricky Ho [mailto:riho@cisco.com] 
Sent: Monday, November 11, 2002 11:40 AM
To: axis-user@xml.apache.org; axis-user@xml.apache.org
Subject: Re: Why seleton and are web service push technology?

 

At 11:20 AM 11/11/2002 +0100, niksa_os wrote:



1) For what reason skeleton classes exist, I mean the ability to
generate this
classes? If I have java class I use axis and make wsdl and client stub.
Why
skeleton classes?


You are suggesting a "dangerous" approach where you generate WSDL from
existing Java classes.  Although most popular examples most web service
tools vendor gives following this pattern, this is not the right
approach.
The right approach is to start with WSDL first without worrying about
your legacy backend implementation.  After that, you need an adaptor to
talk your legacy backend.  The "skeleton class" serves the role as the
adaptor.

[Mike Oliver>>] I completely concur the Skeleton is a much safer and
more easily maintained approach.



2) Are web service push technology  or does it can be? I make web
service
client and I want that client get new data whenever data change at the
server. This can be done with web service? If not, how this can be
done? I can't manage server, I can only get data.


The client need to have a local server running that can accept the
callback.  In other words, during the callback, the roles has turn, the
event source (which is the original server) becomes the client and the
original client becomes the server.  This is a very common pub/sub
scenario.  The client register its interests (together with a callback
address) to the server.  When the event occur, the server callback the
client via the callback address.

 

 

[Mike Oliver>>] Ricky,  that's fine when you have relative peers, but
what about lightweight clients (pda's, etc.)  to web services?  There
the option is polling (ARG!) or some sort of lightweight listener that
doesn't need the full Web Services engine, and only listens for when to
be told to call back to the web services for updated data.  Depending on
what you are doing that can be as easy as an Applet or an RMI server or
even a UDP socket listener, all are typically lighter than servlets or
web services.



Rgds, Ricky


Re: Why seleton and are web service push technology?

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Mattia dongili wrote:

>>You are suggesting a "dangerous" approach where you generate WSDL
>>from existing Java classes.  Although most popular examples most
>>    
>>
>
>but that's exactely what tha Java2WSDL utility does. And I'm expecting it
>will use my original Java class as a service instead of the generated
>skeleton
>(that have the same methods...)
>
>BTW I'm using the Java2WSDL + WSDL2Java approach described in the User
>Guide.
>(do I just need to change the value of <parameter name="className"
>value="pkg.MyServiceSoapBindingImpl"/> in the generated wsdd file to point
>to my original class to bypass this problem?)
>
Hi Mattia,

I've got a detailed example of using the Java2WSDL+WSDL2Java approach 
online at 
http://www.sosnoski.com/presents/java-xml/axis/axis-service.html You 
might want to run through this example if you're having problems.

  - Dennis

Dennis M. Sosnoski
Enterprise Java, XML, and Web Services Support
http://www.sosnoski.com


RE: Why seleton and are web service push technology?

Posted by Mattia dongili <m....@hisn.it>.
> At 11:20 AM 11/11/2002 +0100, niksa_os wrote:
>
>> 1) For what reason skeleton classes exist, I mean the ability to generate
this
>> classes? If I have java class I use axis and make wsdl and client stub.
Why
>> skeleton classes?
>
> You are suggesting a "dangerous" approach where you generate WSDL
> from existing Java classes.  Although most popular examples most

but that's exactely what tha Java2WSDL utility does. And I'm expecting it
will use my original Java class as a service instead of the generated
skeleton
(that have the same methods...)

BTW I'm using the Java2WSDL + WSDL2Java approach described in the User
Guide.
(do I just need to change the value of <parameter name="className"
value="pkg.MyServiceSoapBindingImpl"/> in the generated wsdd file to point
to my original class to bypass this problem?)

> web service tools vendor gives following this pattern, this is not
> the right approach.
> The right approach is to start with WSDL first without worrying
> about your legacy backend implementation.  After that, you need an
> adaptor to talk your legacy backend.  The "skeleton class" serves
> the role as the adaptor.

--
mattia


Re: Why seleton and are web service push technology?

Posted by Ricky Ho <ri...@cisco.com>.
At 11:20 AM 11/11/2002 +0100, niksa_os wrote:
>1) For what reason skeleton classes exist, I mean the ability to generate this
>classes? If I have java class I use axis and make wsdl and client stub. Why
>skeleton classes?

You are suggesting a "dangerous" approach where you generate WSDL from 
existing Java classes.  Although most popular examples most web service 
tools vendor gives following this pattern, this is not the right approach.
The right approach is to start with WSDL first without worrying about your 
legacy backend implementation.  After that, you need an adaptor to talk 
your legacy backend.  The "skeleton class" serves the role as the adaptor.


>2) Are web service push technology  or does it can be? I make web service
>client and I want that client get new data whenever data change at the
>server. This can be done with web service? If not, how this can be
>done? I can't manage server, I can only get data.

The client need to have a local server running that can accept the 
callback.  In other words, during the callback, the roles has turn, the 
event source (which is the original server) becomes the client and the 
original client becomes the server.  This is a very common pub/sub 
scenario.  The client register its interests (together with a callback 
address) to the server.  When the event occur, the server callback the 
client via the callback address.

Rgds, Ricky

Why seleton and are web service push technology?

Posted by niksa_os <ni...@hotmail.com>.
1) For what reason skeleton classes exist, I mean the ability to generate this
classes? If I have java class I use axis and make wsdl and client stub. Why
skeleton classes?

2) Are web service push technology  or does it can be? I make web service
client and I want that client get new data whenever data change at the
server. This can be done with web service? If not, how this can be
done? I can't manage server, I can only get data.

Thanks.