Lesson 1.1: Set up the workspace and create the required projects
Create a WebSphere Application Server
About this task
Procedure
- From the File menu, select .
- Select the appropriate version of WebSphere Application Server as the server type. Click Next.
- If this runtime has not been created in your workspace, you will be prompted to select the installation directory for the server. Click Next.
- Accept the default server port and name. For this tutorial the default server name used will be server1. Click Finish.
- Wait for the server to start. After it has started the
Console view will display Server server1 open for e-business. If the server does not start automatically select
it in the Servers view and click the start icon:
.
Setting the WS-I compliance level
WS-I refers to web service interoperability; this includes interoperability across platforms, operating systems, and programming languages.
About this task
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:
Procedure
- On the main menu bar, click . The Preferences dialog box opens.
- Expand the Require compliance option from the drop-down list branch and expand , and select the
- Click OK.
Creating the web service EJB project
About this task
The remaining steps in this tutorial will be done in the Java™ EE 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.
Procedure
- On the main menu bar, click Next. . Click
- Type TempEJB in the Project name text field. Under Target Runtime ensure that the target server is the appropriate version of WebSphere Application Server. In the EAR Project Name field, enter TempEJBEAR as the EAR name. Click Next.
- Clear the checkbox for creating a client JAR module. The web services wizard will create this module for you. Click Finish.
Results
Creating the web service router project
About this task
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 these steps:
Procedure
- On the main menu bar, click Next. . Click
- Type RouterWebProject in the Name text field. Under Target Runtime ensure that the target server is the appropriate WebSphere Application Server. 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.
- You have now created your router project and your workspace
should look similar to the following:
Adding the projects to the server
About this task
Procedure
- Right-click the server in the Servers view and select Add and Remove. If the Servers view is not open in your workspace, open it from the Window menu by selecting .
- In the window that opens, select TempEJBEAR which contains your router and EJB projects, and click Add.
- Click Finish.
Lesson checkpoint
Now you are ready to begin Lesson 1.2: Import and validate the WSDL file.