The WSIT Tutorial

ProcedureTo Secure the Example Service Application (MCS)

The following example application starts with the example provided in Chapter 3, WSIT Example Using a Web Container and NetBeans IDE and demonstrates adding security to both the web service and to the web service client.

For this example, the security mechanism of Mutual Certificates Security is used to secure the application. To add security to the service part of the example, follow these steps.

  1. If you haven’t already done so, update the GlassFish keystore and truststore files as described in To Update GlassFish Certificates.

  2. Create the CalculatorApplication example by following the steps described in the following sections of Chapter 3, WSIT Example Using a Web Container and NetBeans IDE.

    1. Creating a Web Service

    2. Skip the section on adding Reliable Messaging.

    3. Deploying and Testing a Web Service (first two steps only, do not run the project yet)

  3. Expand CalculatorApplication->Web Services, then right-click the node for the web service, CalculatorWS, and select Edit Web Service Attributes.

  4. Deselect Reliable Messaging if it is selected.

  5. Select Secure Service.

  6. From the drop-down list for Security Mechanism, select Mutual Certificates Security.

  7. Click the Keystore button, then click the Load Aliases button and select xws-security-server. Click OK to close the dialog.

  8. Click OK to close the WSIT Configuration dialog.

    A new file is added to the project. To view the WSIT configuration file, expand Web Pages->WEB-INF, then double-click the file wsit-org.me.calculator.CalculatorWS.xml. This file contains the sc:KeyStore element.

  9. Right-click the CalculatorApplication node and select Run Project.

    A browser will open and display the WSDL file for the application.

  10. Verify that the WSDL file contains the AsymmetricBinding element.

  11. Follow the steps to secure the client application as described in To Secure the Example Web Service Client Application (MCS).