Generate an SEI and a skeleton implementation bean from a WSDL document using Apache CXF

Prerequisites:

  1. Install and configure the Apache CXF runtime environment. See the Requirements and Installation page for more details.
  2. Create a Dynamic Web Project and enable it for Apache CXF Web services development as described here: Create a project for CXF Web services.
  3. Create or import a WSDL document into the Web Content folder of the Dynamic Web Project.
To create an SEI and a skeleton implementation bean from a WSDL document using the Apache CXF runtime environment:
  1. Select Open the Java EE perspectiveWindow > Open Perspective > Java EE from the top level menu to switch to the Java EE perspective.
  2. In the Project Explorer view select the WSDL document that you created or imported into the Dynamic Web Projects Web Content folder.
  3. Open the Web Service wizard by selecting Open the new web service wizardFile > New > Other... > Web Services > Web Service from the top level menu.
  4. Web Services page: select Top down Java bean Web Service as the Web service type and browse to select the WSDL document from which to generate the SEI and implementation bean:

    Top down Web Services Wizard

    1. Move the service slider to the stage of Web services development that you wish to complete.
      • Develop: Invokes the Apache CXF wsdl2java tool using the preference defaults and the information gathered in the wizard to generate an annotated Service Endpoint Interface and supporting classes. The wizard also generates a JAX-WS endpoint configuration file.
      • Assemble: If required by the target server this phase assembles and configures the project that hosts the Web service into an EAR.
      • Deploy: Generates the deployment artifacts for the Web service.
      • Install: Installs and configures the Web Module and EARs on the target server.
      • Start: Starts the target server once the Web service has been installed on it.
      • Test: Use the Web Service Explorer to test the generated Web service.
    2. Server: Select a server to deploy your Web service to.
    3. Web service runtime: Select Apache CXF 2.x
    4. Service project: Select the project in your workspace into which Apache CXF will generate the code.
    5. If you wish to generate a client for your Web service, select Java Proxy as the Client type:
      • Move the client slider to the Develop client stage.
      • Client project: Select a different project into which to generate the client code. The wizard will create the project for you if it doesn't exist and configure it with the CXF Facet.
    6. Publish the Web service: Launch the Web Services Explorer to publish your Web service to a UDDI registry.
    7. Monitor the Web service: Monitor the Web service's SOAP traffic using the TCP/IP Monitor.
  5. Click Next > to move to the first Apache CXF wsdl2java Configuration page:
    1. Output Directory: Specify the source folder in the service project into which the code is generated.
    2. Package Name: Type the Java package name to use for the generated code.
    3. Specify WSDL Namespace to Package Name Mappings: Optionally specify WSDL namespace mappings to Java package names.
    4. Service Name: Specify the name of the WSDL service from which to generate code. The default is to generate code for every service in the WSDL document.
    5. Binding Files: Specify one or more JAX-WS or JAXB binding files.
  6. Click Next > to move to the second Apache CXF wsdl2java configuration page which allows you to override the wsdl2java default preferences:

    Ensure that the Generate Implementation check box is selected and click Next >

  7. Test Web Service page. This page will be displayed if the service slider on the first page was set to Test service.

    Select the launch button to test the Web Service with the Web Services Explorer.

  8. Apache CXF JAX-WS client configuration page: This page will be displayed if the client slider on the Web services page was set to Develop client.

    Refer to the Create a JAX-WS Web Service Client page for information on the options displayed on this page.

  9. Web Service Publication Page: Select whether or not you want to publish this Web service to a UDDI registry. Click Finish

Related tasks

Create a Web Service from a Java implementation bean using Apache CXF
Generate a JAX-WS Web Service Client from a WSDL document using Apache CXF