IntelliJ IDEA 2022.2 Help

Enable Web service client development support

To develop a Web service client in IntelliJ IDEA, the corresponding module must be relevantly configured and supplied with all the required libraries. This section describes the most common ways to meet these requirements.

This approach is applicable if you are going to develop the client side for a Web service of one of the following types:

  • GlassFish/JAXWS2.X RI/Netro 1.X/JWSDP2.0.

  • Apache Axis.

  • RESTful Web Service.

Create a project for a Web service client application

  1. Click New Project on the Welcome screen or select File | New | Project.

  2. From the Generators list, select Jakarta EE.

  3. Name the new project, select a build tool, a language you want to use, and select the Web application project template.

  4. Select the Create Git repository option to place the new project under version control.

  5. From the JDK list, select the JDK that you want to use in your project.

    If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.

    If you don't have the necessary JDK on your computer, select Download JDK.

    Creating new Java Enterprise project
  6. On the next step of the wizard, select the Java Enterprise version to be supported.

  7. From the Dependencies list, select XML Web Services.

  8. Click Create.

Enable Web service client support for an existing project

If you already have a Java Enterprise web application, you can add the Web service client framework support.

  1. Open the build file in the editor (pom.xml or build.gradle depending on the build tool that you use in your project).

  2. Add the following dependency, but make sure to change the version according to your project's requirements:

    Java EE

    <dependency> <groupId>javax.xml.ws</groupId> <artifactId>jaxws-api>/artifactId> <version>2.3.1</version> <scope>provided</scope> </dependency> <dependency> <groupId>javax.jws</groupId> <artifactId>javax.jws-api</artifactId> <version>1.1</version> <scope>provided</scope> </dependency>

    Jakarta EE

    <dependency> <groupId>jakarta.xml.ws</groupId> <artifactId>jakarta.xml.ws-api</artifactId> <version>3.0.1</version> <scope>provided</scope> </dependency>

    Java EE

    compileOnly('javax.xml.ws:jaxws-api:2.3.1') compileOnly('javax.jws:javax.jws-api:1.1')

    Jakarta EE

    compileOnly('jakarta.xml.ws:jakarta.xml.ws-api:3.0.1')
  3. Press Ctrl+Shift+O to import the changes.

For more information on how to work with build tools, refer to Maven or Gradle.

Enable support for extra WS engines or specific implementation versions

Besides most common WS engines, support of which is enabled through dedicated facets, with IntelliJ IDEA you can enable extra WS engines.

You can use any desired WS engine implementation version that you like.

  1. Download the desired WS engine implementation.

  2. In the Settings/Preferences dialog (Ctrl+Alt+S), click Tools | Web Services in the left pane and specify the path to external web service engines, server name and port, and so on (for details, see Web Services).

Last modified: 29 November 2022