You can add Java beans
containing Web service annotation tags to a free-form project. This
generates a WSDL file and Web service deployment descriptors, and
deploy the Web service.
Before you begin
Prerequisites:
Before you can add the Java bean
to the free-form project, the bean must contain the Web service annotation
tags that define how the Web service is deployed. The minimum required
tag is
@WebSphere.WebService, which tells the rapid
deployment tools that you want to deploy a Web service. If you want
to deploy a stateless session EJB Web service, the Java bean that you add to the free-form project
must contain
@ejb.session with
type=Stateless.
For more information about the available tags and how to add them
to your beans, refer to the IBM® Rational® Application Developer
for WebSphere® online help.
About this task
To deploy a Web service from a Java bean
using a free-form project:
Procedure
- Create a directory structure within your free-form project
that maps exactly to the package name for the bean from which you
are deploying the Web service. Note: If your project supports
J2EE 1.3 (as compared to J2EE 1.4), the bean and its package structure
must be contained in the gen/src folder or the free-form
project. If it is located somewhere else the tools creates an SEI
with the same name as the bean which in turn results in a conflict.
- Use your file management system to properly place your Java bean into the free-form project.
The directory name of the free-form project has the same string value
you had provided for the -project parameter used
in the wrd-config command.
- The following activities occur when you drop a bean containing
the @WebSphere.WebService tag to a free-form project:
- The bean searched for annotation tags and is then compiled.
- The bean is analyzed and a Java2WSDL model is created.
If any invalid or malformed tags are encountered the deployment process
aborts.
- The Service Endpoint Interface (SEI) code is generated
and compiled.
- If you are deploying a stateless session EJB Web service,
a Web project is created or selected to act as the router project.
- Java2WSDL creates the WSDL file for the Web service.
- The Web service deployment descriptors, JAX-RPC mapping
file, serializers, deserializers, helper, and holder code are created.
These files are then compiled.
- If you are deploying a stateless session EJB Web service,
the EJB is deployed and the deployment files are compiled.
Results
The Web service endpoint can be accessed with the following
URL: http://<hostname>:<WC_defaulthost>/<free-form
project name>Web/services/<port-component-name>, and
the <port-component-name> element can be
found in the generated webservices.xml in
the Web project.
For example, if your free-form project is
called MyProject, the port-component-name
is MyService. If you have published the application
to myhost using the default ports, then the
endpoint URL is: http://myhost:9080/MyProjectWeb/services/MyService
What to do next
Tip: If you want to monitor the rapid deployment
activity, run your rapid deployment session with console output. You
can complete this by running the rapid deployment launch tool as follows:
wrd.bat -monitor
wrd.sh -monitor
Restriction: There is no support for deleting
Web services deployed by a free-form project at this time.