Generating a JAX-WS 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, create a web application project or an EJB module project.
  2. In the Projects window or Files window, right-click the project node and choose New > Other. 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 in your filesystem or type the URL to a WSDL file.
  6. Select Use Provider if you want to bypass the XML <--> Java binding layer and have the service use raw XML when processing requests. Instead of XML <--> binding, the Provider interface is used. This is an advanced feature and is unselected by default.
  7. Click Finish.

    For JAX-WS web services (Java EE 5 specification), the IDE runs the wsimport tool, which reads the WSDL file and generates all the required artifacts for web service development, deployment, and invocation. Finally, the IDE generates the skeleton implementation class, which corresponds to the WSDL port selected in the wizard.

  8. See Also
    About Web Services
    About Implementing Web Services
    Creating a Web Service from Java
    Creating a WSDL File

    Legal Notices