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
- In the menu bar, click .
- In the New window, click . Click Next.
- In the web services wizard, select Bottom up Java bean web service in the Web
service type list.
- 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.
- Under Configuration:
- Verify that the server is IBM® WebSphere® Application Server
version 7.0 or 6.1. If not, click Server to
select it.
- Verify that the web service runtime is the IBM WebSphere JAX-WS
runtime. If not, click Web service runtime to
select it.
- Click Service project to select
the project that implements your web service.
- Click Service EAR project to
select the application project that contains your web service.
- Click Next.
- 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.
- 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.