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 Ephemeris Lappis <ep...@tiscali.fr> on 2004/12/17 20:18:36 UTC

java2wsdl ant task for document/literal

As many people before i have the same problem with axis 1.2 to generate my
wsdl for javabeans or exceptions. I've been trying some of the solutions
that have been proposed on this list, such as adding complextype or mapping
tags, but the task failed with ClassNotFoundException, although the classes
are in the same classpath.
I have also read in the list this version of axis doesn't handle
document/literal mappings. I precise i can't use another style, since JSR172
for j2me web services restrict possible mappings to this one. So, before i
spend more time on this issue, i'd like to know if actually a solution
exists to generate a correct wsdl for my simplistic javabean (just a pair of
string) and exception. I have built the same application using the sun jwsdk
1.3, and it works quite fine...
Thanks for your feedback.

Philippe Maseres


Re: java2wsdl ant task for document/literal

Posted by Davanum Srinivas <da...@gmail.com>.
Michael,

I do advocate starting from WSDL, but i do find it convenient to start
from a java skeleton code and then tweak the wsdl using the wsdl
editors like XMLSPY.

thanks,
dims


On Mon, 20 Dec 2004 21:31:33 +0100, Michael Schuerig
<mi...@schuerig.de> wrote:
> 
> One thing that didn't become clear for me during this thread is why
> people are using java2wsdl at all. When I started with Axis and web
> services, I, too, had the idea of making Axis generate the "right" WSDL
> for me automagically. I've given up on this idea since. I don't object
> to generating wsdl from a programming language in general, but to my
> mind, in cases where interoperability is of supreme importance, a WSDL
> definition is the starting point. [1]
> 
> The mapping between Java and WSDL involves some loss in either
> direction; the two languages are different in expressiveness and in
> what they emphasize. In particular, I wouldn't expect roundtrip mapping
> to give sensible results.
> 
> Michael
> 
> [1] http://webservices.xml.com/pub/a/ws/2003/07/22/wsdlfirst.html
> --
> Michael Schuerig                           The more it stays the same,
> mailto:michael@schuerig.de                        The less it changes!
> http://www.schuerig.de/michael/      --Spinal Tap, The Majesty of Rock
> 


-- 
Davanum Srinivas - http://webservices.apache.org/~dims/

Re: java2wsdl ant task for document/literal

Posted by Bill Keese <bi...@tech.beacon-it.co.jp>.
Michael -after you hand code the WSDL file (and presumably link the WSDD 
file to the WSDL file as specified in 
http://www.osmoticweb.com/axis-wsdd/wsdlFile.htm), how do you get the 
java files?  For example, assuming that you have a web service to look 
up employee information, you would want at least three java classes:

  Employee (contains employee name, age, phone#, etc.)
  Server (contains getEmployee() function that returns Employee object)
  Client  (Client.getEmployee() calls Server.getEmployee() via SOAP request)

Do you use wdsl2java to generate these java classes, or do you handcode 
them?  Are you using beanSerializer for automatic 
serialization/deserialization of things like class Employee?

Bill

Michael Schuerig wrote:

>One thing that didn't become clear for me during this thread is why 
>people are using java2wsdl at all. When I started with Axis and web 
>services, I, too, had the idea of making Axis generate the "right" WSDL 
>for me automagically. I've given up on this idea since. I don't object 
>to generating wsdl from a programming language in general, but to my 
>mind, in cases where interoperability is of supreme importance, a WSDL 
>definition is the starting point. [1]
>
>The mapping between Java and WSDL involves some loss in either 
>direction; the two languages are different in expressiveness and in 
>what they emphasize. In particular, I wouldn't expect roundtrip mapping 
>to give sensible results.
>
>Michael
>
>
>[1] http://webservices.xml.com/pub/a/ws/2003/07/22/wsdlfirst.html
>  
>

WSDL first - sort of

Posted by to...@gsk.com.
To my mind, unless you are writing code purely as a web service (that is, 
code that could never possibly be reused), it's best to go with writing 
the business logic separately. In this way, it can be tested without 
needing any web service infrastructure in place, and can be written for 
reusability. Once it's done, a first pass WSDL can be generated from the 
business implementation. That can be used as the starting point for 
developing a fixed WSDL. It might need nothing more than adding some 
comments and separating out the XML schema. But you might need to do more 
work for interoperability. Server skeleton classes can then be generated 
from the WSDL and can be changed to delegate to the business class, 
transforming data, where necessary.

In a sense, the above process is still a WSDL first approach because the 
actual web service implementation class is generated from the WSDL, it is 
just that the WSDL is "written" to call some existing functionality (the 
business stuff that you've just written).

Tony

"Michael Schuerig" <mi...@schuerig.de> wrote on 20/12/2004 20:31:33:

> 
> One thing that didn't become clear for me during this thread is why 
> people are using java2wsdl at all. When I started with Axis and web 
> services, I, too, had the idea of making Axis generate the "right" WSDL 
> for me automagically. I've given up on this idea since. I don't object 
> to generating wsdl from a programming language in general, but to my 
> mind, in cases where interoperability is of supreme importance, a WSDL 
> definition is the starting point. [1]
> 
> The mapping between Java and WSDL involves some loss in either 
> direction; the two languages are different in expressiveness and in 
> what they emphasize. In particular, I wouldn't expect roundtrip mapping 
> to give sensible results.
> 
> Michael
> 
> 
> [1] http://webservices.xml.com/pub/a/ws/2003/07/22/wsdlfirst.html
> -- 
> Michael Schuerig                           The more it stays the same,
> mailto:michael@schuerig.de                        The less it changes!
> http://www.schuerig.de/michael/      --Spinal Tap, The Majesty of Rock
> 

RE: java2wsdl ant task for document/literal

Posted by Ephemeris Lappis <ep...@tiscali.fr>.
As i already said before, i'm not a soap expert, not at all.
Nevertheless, i think generating wsdl files from existing java code is an
easy way : wsdl syntax is not so friendly.
I known such a comparison is not always welcome : with CORBA we all first
write the services interface, using IDL, before code generation. But, from
my point of view, IDL is quite more easy to write than wsdl !
I agree with you about interoperability. In this domain, i'd like to have
actual feedback from real projects. I really think all these web services
miracle appear a bit confusing, just as wsdl syntax !
Your suggestion about alternative methods and tools to mkae wsdl first are
welcome...
Regards.
Philippe Maseres

<<<Philippe>>> -----Message d'origine-----
<<<Philippe>>> De : Michael Schuerig [mailto:michael@schuerig.de]
<<<Philippe>>> Envoyé : lundi 20 décembre 2004 21:32
<<<Philippe>>> À : axis-user@ws.apache.org
<<<Philippe>>> Objet : Re: java2wsdl ant task for document/literal
<<<Philippe>>>
<<<Philippe>>>
<<<Philippe>>>
<<<Philippe>>> One thing that didn't become clear for me during
<<<Philippe>>> this thread is why
<<<Philippe>>> people are using java2wsdl at all. When I started
<<<Philippe>>> with Axis and web
<<<Philippe>>> services, I, too, had the idea of making Axis
<<<Philippe>>> generate the "right" WSDL
<<<Philippe>>> for me automagically. I've given up on this idea
<<<Philippe>>> since. I don't object
<<<Philippe>>> to generating wsdl from a programming language in
<<<Philippe>>> general, but to my
<<<Philippe>>> mind, in cases where interoperability is of supreme
<<<Philippe>>> importance, a WSDL
<<<Philippe>>> definition is the starting point. [1]
<<<Philippe>>>
<<<Philippe>>> The mapping between Java and WSDL involves some loss
<<<Philippe>>> in either
<<<Philippe>>> direction; the two languages are different in
<<<Philippe>>> expressiveness and in
<<<Philippe>>> what they emphasize. In particular, I wouldn't
<<<Philippe>>> expect roundtrip mapping
<<<Philippe>>> to give sensible results.
<<<Philippe>>>
<<<Philippe>>> Michael
<<<Philippe>>>
<<<Philippe>>>
<<<Philippe>>> [1]
<<<Philippe>>> http://webservices.xml.com/pub/a/ws/2003/07/22/wsdlfirst.html
<<<Philippe>>> --
<<<Philippe>>> Michael Schuerig                           The more
<<<Philippe>>> it stays the same,
<<<Philippe>>> mailto:michael@schuerig.de
<<<Philippe>>> The less it changes!
<<<Philippe>>> http://www.schuerig.de/michael/      --Spinal Tap,
<<<Philippe>>> The Majesty of Rock


Re: java2wsdl ant task for document/literal

Posted by Michael Schuerig <mi...@schuerig.de>.
One thing that didn't become clear for me during this thread is why 
people are using java2wsdl at all. When I started with Axis and web 
services, I, too, had the idea of making Axis generate the "right" WSDL 
for me automagically. I've given up on this idea since. I don't object 
to generating wsdl from a programming language in general, but to my 
mind, in cases where interoperability is of supreme importance, a WSDL 
definition is the starting point. [1]

The mapping between Java and WSDL involves some loss in either 
direction; the two languages are different in expressiveness and in 
what they emphasize. In particular, I wouldn't expect roundtrip mapping 
to give sensible results.

Michael


[1] http://webservices.xml.com/pub/a/ws/2003/07/22/wsdlfirst.html
-- 
Michael Schuerig                           The more it stays the same,
mailto:michael@schuerig.de                        The less it changes!
http://www.schuerig.de/michael/      --Spinal Tap, The Majesty of Rock