Creating a web service from an annotated Java bean by using a wizard

After annotating a Java™ bean, you can generate a web service application by using the web services wizard. With the wizard, you can create a WSDL file in your web services project before you deploy the application to a server.

Before you begin

Prerequisite: For a Java bean in your workspace, you must have specified web services annotations, including at least the @WebService annotation.

About this task

Note: If the bean already has a @javax.jws.WebService annotation, many of the fields in the wizard will be disabled because the wizard does not need to generate a delegate bean for you. You will only be able to select to generate a WSDL file. If you have added only the @javax.jws.WebService to your Java bean and want to enable other options such as SOAP 1.2 binding or MTOM, you should exit the wizard and either remove the annotation or proceed to create the web service using the annotations documentation. The wizard will not allow you to append new annotations to a pre-existing partially annotated bean.
To create a web service from an annotated Java bean:

Procedure

  1. In the menu bar, click File > New > Other.
  2. In the New window, click Web Services > Web Service. Click Next.
  3. In the web services wizard, select Bottom up Java bean web service in the Web service type list.
  4. In the Service implementation field, type the name of the Java bean that implements your web service, or use the Browse button to select this bean.
  5. Under Configuration:
    1. Verify that the server is IBM® WebSphere® Application Server version 7.0 or up. If not, click Server to select it.
    2. Verify that the web service runtime is the IBM WebSphere JAX-WS runtime. If not, click Web service runtime to select it.
    3. Click Service project to select the project that implements your web service.
    4. Click Service EAR project to select the application project that contains your web service.
  6. Click Next.
  7. If you want to create a Web Services Description Language (WSDL) service contract from your Java bean, select the Generate WSDL into the project check box. A WSDL file for your web service will be created in the WebContent\WEB-INF\wsdl folder of the project that implements your web service.
  8. Click Finish to complete the wizard

Results

Your Java bean is published as a web service on the server that you specified. If the level of service generation that you selected in the wizard was Start or Test, your web service is also started.
Note: If you used the @BindingType annotation in your Java bean to specify a WSDL 1.1 SOAP 1.2 binding, the wizard generates a WSDL file with this type of binding.

For more information about the web services wizard, including other options for your web service, see the related tasks.

Icon that indicates the type of topic Task topic
Timestamp icon Last updated: July 17, 2017 21:58

File name: twsandoc005.html