• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Tim Cooke
  • Bear Bibeault
  • paul wheaton
Saloon Keepers:
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Mikalai Zaikin
  • Piet Souris

Java2WSDL command inside WebSphere how to use it!

Ranch Hand
Posts: 182
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dear All,
still struggling with the my first steps to deploy Web Service...i know you here to give us some aid..please dont hesitate..
i tried to use Java2WSDL command in this format
for example if i have Hello.class interface in the same directory of Java2WSDL- that contains one method that return "Hi EveryBody" -and i want to generate a WSDL file.
if i write
Java2WSDL Hi
Java2WSDL Hi.class
i have this Excption:
java.io.IOException: java.lang.ClassNotFoundException: Hi
at com.ibm.ws.webservices.wsdl.fromJava.Emitter.init(Emitter.java:794)
at com.ibm.ws.webservices.wsdl.fromJava.Emitter.getWSDL(Emitter.java:659
at com.ibm.ws.webservices.wsdl.fromJava.Emitter.emit(Emitter.java:589)
at com.ibm.ws.webservices.wsdl.fromJava.Emitter.preEmit(Emitter.java:482
at com.ibm.ws.webservices.wsdl.fromJava.Emitter.emit(Emitter.java:524)
at com.ibm.ws.webservices.wsdl.fromJava.Emitter.emit(Emitter.java:563)
at com.ibm.ws.webservices.tools.Java2WSDL.run(Java2WSDL.java:607)
at com.ibm.ws.webservices.tools.Java2WSDL.main(Java2WSDL.java:653)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
at java.lang.reflect.Method.invoke(Method.java:615)
at com.ibm.ws.bootstrap.WSLauncher.main(WSLauncher.java:263)

Any kindly Help Please or at least give me link or example of using this command witohut IDE like Rational for generate appropriate WSDL file .
thanks a lot for everyone help or try to help either.
Posts: 27902
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know much about web services. But the relevant error message is this one:

java.lang.ClassNotFoundException: Hi

So did you mean to use a class named "Hi"? If so, then it should be in your classpath. And most likely it should be in a package too, but I don't know that for certain. But if you didn't expect to be using the "Hi" class, then there's something wrong with your web service.
[ November 15, 2006: Message edited by: Paul Clapham ]
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You mention Hello.class in your text but list Hi.class in your commandline example. Which is it?

Why is Hi.class in the same directory as Java2WSDL? It should be in a package or in a package in a jar. And that directory or jar should be on the classpath.


In this example /home/timle/bin should be on the classpath. And you should invoke

Java2WSDL net.thelemasters.hi.Hi
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Hani,
Java2WSDL: Building WSDL from Java
The Java2WSDL and WSDL2Java emitters make it easy to develop a new web service. The following sections describe the steps in building a web service from a Java interface.

Step 1: Provide a Java interface or class
Write and compile a Java interface (or class) that describes the web service interface. Here is an example interface that describes a web services that can be used to set/query the price of widgets (samples/userguide/example6/WidgetPrice.java):

package samples.userguide.example6;

* Interface describing a web service to set and get Widget prices.
public interface WidgetPrice {
public void setWidgetPrice(String widgetName, String price);
public String getWidgetPrice(String widgetName);
}Note: If you compile your class with debug information, Java2WSDL will use the debug information to obtain the method parameter names.

Step 2: Create WSDL using Java2WSDL
Use the Java2WSDL tool to create a WSDL file from the interface above.

Here is an example invocation that produces the wsdl file (wp.wsdl) from the interface described in the previous section:

% java org.apache.axis.wsdl.Java2WSDL -o wp.wsdl
-n "urn:Example6" -p"samples.userguide.example6" "urn:Example6"

-o indicates the name of the output WSDL file
-l indicates thelocation of the service
-n is the target namespace of the WSDL file
-p indicates a mapping from the package to a namespace. There may be multiple mappings.
the class specified contains the interface of the webservice.
The output WSDL document will contain the appropriate WSDL types, messages, portType, bindings and service descriptions to support a SOAP rpc, encoding web service. If your specified interface methods reference other classes, the Java2WSDL tool will generate the appropriate xml types to represent the classes and any nested/inherited types. The tool supports JAX-RPC complex types (bean classes), extension classes, enumeration classes, arrays and Holder classes.

The Java2WSDL tool has many additional options which are detailed in the reference guide. There is an Ant Task to integrate this action with an Ant based build process.

you can refer to axis user guide.
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

and i use the axis2-1.5.1 is in my D:\
so how the java2wsdl file creation has to done
by your reply that part i had done like this

D:\axis2-1.5.1>java org.apache.axis.wsdl.Java2WSDL -o wp.wsdl -l"http://localhos
t:8080/axis/services/WidgetPrice" -n "urn:Example6" -p"samples.userguide.example
6" "urn:Example6" com.salish.Webserver
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/axis/wsdl/
Caused by: java.lang.ClassNotFoundException: org.apache.axis.wsdl.Java2WSDL
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
what is the problem

mycomputer>>>properties>>> Environmental Variable
JAVA_HOME=====C:\Program Files\Java\jdk1.6.0

what is the problem what i has to do

what are steps need for me to start a webservices program .what is the axis,what is cxf ,what is REStful webservices, where i has to put the files to work as a web services
I'm using eclipse in that the webservices project is making as a simple as but i want to do ti with the notepad free from IDE so from where i has to strart

sorry for these foolish question
but please help me
thanks in advance

Bring out your dead! Or a tiny ad:
Low Tech Laboratory
    Bookmark Topic Watch Topic
  • New Topic