aspose file tools*
The moose likes Web Services and the fly likes how can i create java classes from given wsdl    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "how can i create java classes from given wsdl    " Watch "how can i create java classes from given wsdl    " New topic
Author

how can i create java classes from given wsdl

Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
Hello all
i have given wsdl that i need to extract java classes from it
this is not wsdl in web server but wsdl as file .
is there simple way to do it ?
im using JAXWS
Thanks
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Meir Yan:
this is not wsdl in web server but wsdl as file.


That shouldn't matter most code generators (wscompile, WSDL2Java, etc.) accept a server-based URL or a local file path. The following topics may be helpful:

From wsdl to web service
how can i create java classes from given wsdl

You didn't identify which JAX-WS implementation you are using - different implementations use different names for their (equivalent) code generators.
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
well i did use axis 1.4 and it didn't worked well with my wsdl file
( that was generated using perl idl2wsdl tool )
and now i like to try the JAXWS
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
by the way this is what i had with Axis maybe someone here have some experience with the subject :

have wsdl file (generated from ) perl idl2wsdl Now I fixed the file according to this link :
http://www.omg.org/issues/issue7834.txt

but when I run the WSDL2java class im getting this error :
java -cp
axis.jar;log4j-1.2.8.jar;commons-discovery-0.2.jar;commons-logging-1.0.4
.jar;jaxrpc.jar;saaj.jar;wsdl4j-1.5.1.jar;xml-apis.jar;xercesImpl.jar
org.apache.axis.wsdl.WSDL2Java test.wsdl





this lead me to this link :
http://issues.apache.org/jira/browse/AXIS-1337?page=com.atlassian.jira.p
lugin.system.issuetabpanels:changehistory-tabpanel

I don't like to compile the axis app ..
so what can I do ? why this bug didn't fixed ?
or there is different problem here ?

my axis version is downloaded from here :
http://mirror.mirimar.net/apache/ws/axis/1_4/
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
If the error cited by the link you gave is similar to your case then you should be able to "fix" the WSDL
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200406.mbox/%3C781850700.1086399353329.JavaMail.apache@nagoya%3E

For example, instead of



use



i.e. make sure the targetNameSpace matches in the definitions and xsd:schema elements.

Also note that anonymous complexTypes have been a problem in the past.
http://www.mail-archive.com/axis-user@xml.apache.org/msg16426.html

So to be on the safe side make sure that all xsdxsd:complexType elements have a name attribute. E.g.:
Meir Yan
Ranch Hand

Joined: Apr 27, 2006
Posts: 597
ok i willl take alook , but for now , how can i make java classes from
JAXWS from given wsdl
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Originally posted by Meir Yan:
but for now , how can i make java classes from
JAXWS from given wsdl


well ... as I said in my first reply:

Originally posted by Peer Reynders:
You didn't identify which JAX-WS implementation you are using ...


JAX-WS (JSR-224) is a specification - not a tool, toolkit or framework.

The Axis2 implementation is guided by JAX-WS and it still uses it's own WSDL2Java.
Sun's reference implementation uses wscompile.
Apache CXF uses its own wsdl2java
JBoss-WS uses wsconsume
etc.

So basically each Java-based, JAX-WS implementing web services toolkit has its own tool for the job.
sasank ch
Greenhorn

Joined: Nov 07, 2007
Posts: 25
You need to put required jar files in the classpath common-logging i guess there are around 10 jars
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i create java classes from given wsdl