Develop a WSDL file for JAX-RPC applications
We can develop a WSDL file to describe the characteristics of the JAX-RPC Web services application including where the service resides and how to invoke the service using an XML format.
Depending on the development path, develop a service endpoint interface from a Java Beansimplementation or develop a service endpoint interface from an enterprise bean implementation.
we need a WSDL file to use Web services. We can develop your own WSDL file or get one from a Web services provider through e-mail, downloading, or through a URL. This documentation assumes you are creating the own.
Develop a WSDL file by following the actions listed:
- Set the service endpoint interface class and referenced classes into the CLASSPATH variable.
- On Windows systems, set CLASSPATH="%CLASSPATH%;<list the application JAR files and classes>".
- On UNIX and Linux systems, export CLASSPATH="$CLASSPATH:<list the application JAR files and classes>".
- Run the Java 2WSDL seiInterface command.
A WSDL file named seiInterface.wsdl is created.
- Move the WSDL file to the META-INF/wsdl subdirectory if we are using EJBs.
- Move the WSDL file to the WEB-INF/wsdl subdirectory if we are using Java Beans.
- Edit the generated WSDL file and inspect the part names.
The WSDL parts have names like arg_0_0. Modify the WSDL file to use the actual names of the Java parameters.
- (Optional) Use the Java 2WSDL command tool to generate the correct part names of WSDL file. We can automatically generate and set the correct part names by using the Java 2WSDL command tool. Generating and setting the part names is done by providing additional information to the Java 2WSDL command tool in the form of a Java implementation class that implements the same methods as the service endpoint interface and is compiled with debug information turned on. Parameter names are stored in the .class file with the debug information. If the implementation class is compiled with debug on, we can use the Java 2WSDL -implClass seiImpl seiInterface command to generate a WSDL file with the proper part names.
Results
A WSDL file that defines the Web services described by the service endpoint interface.
Example
This example uses the JAR file name AddressBook.jar that contains a class named AddressBook.class class file.
You must add the AddressBook.jar file to the CLASSPATH to create the WSDL file. The JAR file contains an EJB implementation class that is compiled with debugging information turned on. Run the Java 2WSDL -implClass addr.AddressBookBean addr.AddressBook command to create the file, AddressBook.wsdl.
Next steps
Depending on the development path, develop Web services deployment descriptor templates for Java Beans or develop Web services deployment descriptor templates for an enterprise beans implementation.
Java 2WSDL command for JAX-RPC applications
Mapping between Java language, WSDL and XML for JAX-RPC applications 
Related concepts
WSDL
Assembly tools
Related tasks
Implementing Web services applications with JAX-RPC
Implementing Web services applications from existing WSDL files with JAX-RPC
Develop a service endpoint interface from Java Beans for JAX-RPC applications
Develop a service endpoint interface from enterprise beans for JAX-RPC applications
Develop JAX-RPC Web services deployment descriptor templates for a Java Beans implementation
Develop JAX-RPC Web services deployment descriptor templates for an enterprise bean implementation
Making deployed Web services applications available to clients
Related
Artifacts used to develop Web services