Operating Systems: i5/OS
Personalize the table of contents and search results
Develop a WSDL file for JAX-RPC applications
This topic explains how to develop a Web Services Description Language
(WSDL) file for JAX-RPC applications.
Depending on your development path, develop a Service Endpoint Interface for a Java bean implementation or develop a Service Endpoint Interface
from an EJB remote interface.
Overview
You need a WSDL file to use Web services. You 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 your own.
Develop a WSDL file by following the actions
listed:
Procedure
- Run the Start Qshell (STRQSH) command
to start the Qshell.
- Update the CLASSPATH environment variable to
include the location of the service endpoint interface class and other referenced
classes...
export -s CLASSPATH=/myapp/myclass.class:/myapp/myjar.jar
- Run the Java2WSDL seiInterface command. A
WSDL file named seiInterface.wsdl is created.
- Move the WSDL file to the META-INF/wsdl subdirectory if you
are using Enterprise JavaBeans (EJB).
- Move the WSDL file to the WEB-INF/wsdl subdirectory if you
are using JavaBeans.
- 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 Java2WSDL command tool to generate the
correct part names of WSDL file. You can automatically generate
and set the correct part names by using the Java2WSDL command tool.
Generating and setting the part names is done by providing additional information
to the Java2WSDL 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 your implementation
class is compiled with debug on, you can use the Java2WSDL -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 your CLASSPATH to create the WSDL
file. The JAR file contains an EJB implementation class that is compiled with
debugging information turned on. Run the Java2WSDL -implClass addr.AddressBookBean
addr.AddressBook command to create the file, AddressBook.wsdl.
What to do next
Depending on your development path, develop Web services deployment descriptor templates for a Java
bean implementation or develop Web services deployment descriptor templates for an EJB
implementation.
}
Java2WSDL command for JAX-RPC applications
Mapping between Java language, WSDL and XML for JAX-RPC applications
Related concepts
WSDL
Related tasks
Developing Web services applications from existing WSDL files with
JavaBeans
Developing Web services applications from existing WSDL files with
enterprise beans
Developing Web services applications from enterprise beans
Making deployed Web services application available to clients
Related Reference
WSDL architecture
Multipart WSDL best practices
Artifacts used to develop Web services
Java2WSDL command for JAX-RPC applications
|