Creating a JAX-WS enabled project
You can create a project that is enabled to use JAX-WS, and then add
your project to an enterprise archive (EAR) file or an OSGi application.
Before you begin
About this task
You can build a project that points to the WebSphere server that you created.
Procedure
- In the Java™ EE perspective, right-click your enterprise application project and select New > Web Project to open the web project wizard.
- In the Name field, type a name for your new web project.
- In the Project Templates section, select the type of web template you want to use: select Simple to create a simple web project.
- In the Programming Model section, select the programming model that you want to use: select Java EE or OSGi. Click Next to configure your new web project.
- On the deployment page, from the
list of available configuration options, click Deployment to
open the Deployment configuration page.
- You can change Target runtime by selecting another one from the drop-down box. Click Change Features to open the Project Facets window. If you are targeting WebSphere Application Server v7.0 or later, the default configuration is adequate for JAX-WS web service development.
- Click Add support for WebSphere bindings and extensions or clear this field.
- In the Web module version field, select the web module version that you want to use.
Add your project to an EAR file or an OSGi application.
- If you selected Java EE for your programming model, then add your project
to an EAR file. In the EAR membership field, click Add project to
an EAR, if you want to include EAR membership; clear this field if you do not want to
add the web project to an EAR file.
The New project wizard generates the EAR.
If you selected OSGi for your programming model, then add your project to an OSGi application. In the Application field, click Add to Application; clear this field if you do not want to associate the OSGi bundle with an OSGi application.
The New project wizard generates the OSGi application.
- If you selected Java EE for your programming model, then add your project
to an EAR file. In the EAR membership field, click Add project to
an EAR, if you want to include EAR membership; clear this field if you do not want to
add the web project to an EAR file.
In the EAR membership field, click Add project to an EAR, if you want to include EAR membership; clear this field if you do not want to add the web project to an EAR file. The New project wizard generates the EAR.
The name of your file is displayed.
- For the Java EE programming model, the name of your file is in the EAR project name field.
For the OSGi programming model, the name of your file is in the Application name field.
In the EAR project name field, the name of your existent EAR file appears. You can click Browse to select a different EAR file.
- Click Finish.
Note: The deployment option is not available if you selected the Client-side only programming model for your new web project. - From the list of available configuration
options, click Java to open the Java configuration page.
- In the Source folders on build path field, accept the default src directory, or click Add Folder, Edit... or Remove to specify a folder for your source files.
- In the Default output folder: field, specify a folder for your output files or accept the default value (WebContent\WEB-INF\classes).
- From the list of available configuration options,
click Web Module. On the Web Module
configuration page:
- In the Context root field, type the name of your web project root, or accept the default (which is the name of your web project).
- In the Content directory field, type the name of your content directory, or accept the default (WebContent).
- Select Generate web.xml deployment descriptor if you want to create a deployment descriptor. You can also add a deployment descriptor to your web module later.
- To associate the project with the server, right-click the WebSphere server that you created in the Servers view and click Add and Remove Projects. Select the service and client projects from the Available projects list and click Add.
Parent topic: Creating a JAX-WS-enabled WebSphere server

