Creating a Web Service from a WSDL File

See Also 

When you and your business partners agree on a "contract" in the form of a WSDL file, you can use the IDE to implement it. The WSDL file is an agreement on the data and messages that will be exchanged as well as how these messages will be sent and received. In the IDE, you can use the WSDL file to implement the web service.

Business requirements may demand that you create a platform-independent description of a web service as a set of XML schema files and WSDL files. Based on this platform-independent description, you can use the steps that follow to generate the implementation files. The WSDL file that you use in the steps below can either be available on disk or via a URL. You can even create the WSDL file yourself, using the IDE, as described in Creating a WSDL File.

To create a web service from a WSDL file:

  1. Depending on the implementation form, do one of the following:
  2. In the Projects window or Files window, right-click the project node and choose New > File/Folder. In the Web Services folder, choose Web Service from WSDL.
  3. The New Web Service from WSDL wizard opens.

  4. Type the web service name and specify a package to house the web service.
  5. Browse to a WSDL file on your filesystem.
  6. Click Finish.

    For JAX-WS web services (Java EE 5 specification), the IDE runs the wsimport tool, which results in the following:

    For JAX-RPC web services (J2EE 1.4 specification), the IDE runs the wscompile tool, which results inS the following:

    By default, the WSDL file is housed in the WEB-INF/wsdl (or META-INF/wsdl) folder. The interface and the implementation class are housed in a package within your project's src folder (in the Files window) and you can access them in the Source Packages node (in the Projects window).
  7. See Also
    About Web Services
    About Implementing Web Services
    Creating a Web Service from Java
    Creating a WSDL File

    Legal Notices