< Previous | Next >

Lesson 1.1: Set up the workspace and create the required projects

Create a WebSphere Application Server v6.1 server

To create a WebSphere Application Server do the following:
  1. From the File menu, select New > Other > Server > Server > Next.
  2. Select WebSphere v6.1 Server as the server type. Click Next.
  3. If this runtime has not been created in your workspace, you will be prompted to select the installation directory for the server. Click Next.
  4. Accept the default server port and name. Click Finish.
  5. Wait for the server to start. once it has started the console will display Server server1 open for e-business;

Setting the WS-I compliance level

WS-I refers to Web service interoperability; this includes interoperability across platforms, operating systems, and programming languages.

The WS-I organization sets out standards collected in documents called Profiles that define the requirements needed to make a Web service interoperable. The Rational Developer products validate Web services against the WS-I Simple SOAP Binding Profile 1.0 (WS-I SSBP) and the WS-I Attachments Profile 1.0 (WS-I AP). For more information on WS-I, refer to their Web site: http://www.ws-i.org/

By default, the WS-I SSBP compliance level is set to Ignore. With this setting, no warning will be given if non-compliant choices are made. This compliance level is used by the Web service wizards and the WSDL validation tool. This sample generates a WS-I compliant Web service, therefore you should set the WS-I compliance level to Require.

You can change the WS-I compliance level by following the proceeding steps:

  1. On the main menu bar, click Window > Preferences. The Preferences dialog box opens.
  2. Expand the Web Services branch and select WebSphere > WS-I BSP Compliance.
  3. Select the Require option from the drop-down list beside WS-I SSBP.
  4. Click OK.

Creating the Web service EJB project

The remaining steps in this tutorial will be done in the J2EE perspective. If you are asked if you want to change to another perspective after performing a task, select No.

The EJB project will contain the business logic for the Web service as well as the WSDL file.

  1. On the main menu bar, click File > New > Project > EJB > EJB Project. Click Next.
  2. Type TempEJB in the Name text field. Under Target Runtime ensure that the target server is WebSphere Application Server v6.1. In the EAR Project Name field, enter TempEJBEAR as the EAR name. Click Next.
  3. By default the correct facets for this type of project will be selected. Click Next.
  4. Clear the checkbox for creating a client JAR module. The Web services wizard will create this module for you. Click Finish.
The EJB project that will contain the Web service logic and the associated EAR are created. The EJB project will have an error associated with it because it does not contain an enterprise bean. The bean will be generated by the Web services wizard.

Creating the Web service router project

EJB Web services require a router project. This project contains the router servlet that acts as the endpoint for the service and will call out to the EJB. If you are using SOAP over JMS as your transport method the router project needs to be an EJB project. If you are using SOAP over HTTP as we are in this tutorial, the router project should be a Web project. The project you create must be added to the same EAR as the EJB project that will contain the enterprise bean. This project should not contain any of the business logic for your Web service.

You can create a Web project by following the proceeding steps:

  1. On the main menu bar, click File > New > Project > Web > Dynamic Web Project. Click Next.
  2. Type RouterWebProject in the Name text field. Under Target Runtime ensure that the target server is WebSphere Application Server v6.1. In the EAR Project Name field, ensure TempEJBEAR is selected. This will ensure that the enterprise bean that you will create later and your router project are both referenced in the same EAR. Click Finish.
  3. You have now created your router project and your workspace should look similar to the following:
    Project Explorer with EJB project, EAR, and router Web project

Adding the projects to the server

You can associate the project with the server that your Web service will run on by following these steps:
  1. Right-click the server in the Servers view and select Add and Remove projects. If the Servers view is not open in your workspace, open it from the Window menu by selecting Show View > Servers.
  2. In the window that opens, select TempEJBEAR which contains your router and EJB projects, and click Add.
  3. Click Finish.

Lesson checkpoint

< Previous | Next >