Deploying Web services using a free-form project

You can add Java™ beans containing Web service annotation tags to a free-form project. This will generate a WSDL file and Web service deployment descriptors, and deploy the Web service.
Restriction: You can use the rapid deployment tools for packaging applications at J2EE 1.3 or 1.4 specification-levels. However, the rapid deployment tools do not support Java EE 5.0 nor J2EE 1.2 specification-level.
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 will be 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 on the available tags and how to add them to your beans, refer to the IBM® Rational Application Developer for WebSphere online help.
To deploy a Web service from a Java bean using a free-form project:
  1. 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 will create an SEI with the same name as the bean which in turn will result in a conflict.
  2. 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.
  3. The following activities occur when you drop a bean containing the @WebSphere.WebService tag to a free-form project:
    1. The bean searched for annotation tags and is then compiled.
    2. The bean is analyzed and a Java2WSDL model is created. If any invalid or malformed tags are encountered the deployment process will abort at this point.
    3. The Service Endpoint Interface (SEI) code is generated and compiled.
    4. If you are deploying a stateless session EJB Web service, at this point a Web project is created or selected to act as the router project.
    5. Java2WSDL creates the WSDL file for the Web service.
    6. The Web service deployment descriptors, JAX-RPC mapping file, serializers, deserializers, helper and holder code are created. These files are then compiled.
    7. If you are deploying a stateless session EJB Web service, at this point the EJB is deployed and the deployment files are compiled.

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 will be: http://myhost:9080/MyProjectWeb/services/MyService

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:
  • This graphic is a Windows icon. On Windows:wrd.bat -monitor
  • This graphic is a UNIX icon. On UNIX:wrd.sh -monitor
Restriction: There is no support for deleting Web services deployed by a free-form project at this time.

Feedback