Develop a WSDL file for JAX-RPC applications

 

+

Search Tips   |   Advanced Search

 

 

Overview

We 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

  1. Depending on your development path...

  2. Configure the service endpoint interface class and referenced classes into your CLASSPATH variable.

    • On Windows...

      set CLASSPATH="%CLASSPATH%;%JARPATH%"

    • On UNIX and Linux...

      export CLASSPATH="$CLASSPATH:$JARPATH"

  3. Run...

    Java2WSDL AppName_SEI

    A WSDL file named AppName_SEI.wsdl is created.

  4. Move the WSDL file to...

    META-INF/wsdl

    ...if you are using EJBs.

    Move the WSDL file to...

    WEB-INF/wsdl

    ...if you are using JavaBeans.

  5. 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.

  6. (Optional) Use Java2WSDL tool to generate the correct part names of WSDL file.

    Pass as a parameter a Java implementation class that has 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...

    Java2WSDL -implClass AppName_Impl AppName_SEI

    ...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.

Add the AddressBook.jar file to your CLASSPATH.

The JAR file contains an EJB implementation class that is compiled with debugging information turned on. Run...

Java2WSDL -implClass addr.AddressBookBean addr.AddressBook

...to create the file, AddressBook.wsdl.

 

What to do next

Depending on your development path



Java2WSDL command for JAX-RPC applications
Map between Java language, WSDL and XML for JAX-RPC applications

 

Related concepts

WSDL

 

Related tasks

Develop Web services applications from existing WSDL files with JavaBeans
Develop Web services applications from existing WSDL files with enterprise beans
Develop Web services applications from enterprise beans
Make 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