Preparing to Develop a Web Service
On this page:
- Before you start
- Enabling Web Services Development Support through a Dedicated Facet
- Adding the Necessary Libraries to an Existing Modules
- Enabling an Extra WS Engine
Before you start
Make sure the Web and JavaEE: WebServices (JAX-WS) bundled plugins are enabled. The plugins are bundled with IntelliJ IDEA and activated by default. If the plugins are not activated, enable them on the Plugins page of the Settings / Preferences Dialog as described in Enabling and Disabling Plugins.
To develop a Web service in IntelliJ IDEA, the corresponding module must be relevantly configured and supplied with all the required libraries and servlet references. This section describes the most common ways to meet these requirements.
Enabling Web Services Development Support through a Dedicated Facet
Integration with Struts is enabled through the Web and Web Services facets. These dedicated facets contain settings, configuration file paths, and validation rules. This information determines the structure of a module so IntelliJ IDEA detects how to treat the module contents.
A Web Services facet can be only added as a child of a Web facet. Note that only one Web Services facet is allowed in a module.
You can create a new module with the dedicated facets or add the facets to an existing module. In either case, IntelliJ IDEA downloads the predefined WS engine implementation version.
Do one of the following:
If you are going to create a new project:
click Create New Project on the Welcome screen or
select File | New | Project.
As a result, the New Project wizard opens.
If you are going to add a module to an existing project:
open the project you want to add a module to, and
select File | New | Module.
As a result, the New Module wizard opens.
- If you are going to create a new project: click Create New Project on the Welcome screen or select File | New | Project.
- On the first page of the wizard, in the left-hand pane, select Java. In the right-hand part of the page, specify the JDK that you are going to use.
- Under Additional Libraries and Frameworks, select the Web Application check box.
- Select the WebServices check box.
- Select the desired WS engine implementation from the Version list.
a library that implements
the selected WS engine.
You can choose to use an existing library, create and use a new one,
download the library files if they are not yet available on your computer,
or postpone setting up the library until a later time.
Select the library to be used from the list
(if the corresponding library is already defined in IntelliJ IDEA).
Create. If the corresponding library files (
.jar) are already available on your computer, you can arrange those files in a library and use that new library. To do that, click Create and select the necessary files in the dialog that opens. (Use the Ctrl key for multiple selections.)
Select this option to download
the WS engine implementation.
(The downloaded files will be arranged in a library.)
Optionally, click Configure to edit the library settings and contents. (The Downloading Options dialog will open.)
- Set up library later. Select this option to postpone setting up the library until a later time.
- Use library. Select the library to be used from the list (if the corresponding library is already defined in IntelliJ IDEA).
- Specify the name and location settings. For more information, see Project Name and Location or Module Name and Location.
Adding the Necessary Libraries to an Existing Modules
This approach is applicable if the necessary libraries have been previously downloaded.
- Open the module settings.
- With the desired module selected, click the Dependencies tab.
- To enable Web development, click the Add button
and select from the context menu.
In the dialog that opens,
javaee.jarlibrary and click OK.
- Click the Add button again, then select from the context menu.
In the dialog that opens, select the
javaee.jarlibrary and the required Web service-specific libraries.
- Click OK when ready.
Enabling an Extra WS Engine
Besides most common WS engines, support of which is enabled through dedicated facets, with IntelliJ IDEA you can also use the following ones:
Moreover, you can use any desired WS engine implementation version instead of restricting yourself to the predefined one.
To use a custom WS engine:
- Download the desired WS engine implementation.
- Specify the WS engine location on the Web Services page of the Settings dialog box.
- Enable Web development support.
- On the main menu, choose .
- In the Enable Web Services Support dialog box that opens specify the following: