uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

10.12 Connection by basic authentication

From the Web Service client, you can connect with the Web Service that supports basic authentication.

This section describes the property settings required for connection by basic authentication.

Organization of this section
(1) Specifying the property values
(2) Method of specifying the properties

(1) Specifying the property values

To access the Web Service with basic authentication, specify the value in the action definition file or message context. The following table describes the properties for connection by basic authentication and the specified contents:

Table 10-17 Properties for connection by basic authentication

No. Properties Specified contents Required
1 javax.xml.ws.security.auth.username Set up the user ID. Y
2 javax.xml.ws.security.auth.password Set up the password. Y

Legend:
Y: Indicates that the specification of the property is required.

Precautions for connection by basic authentication
  • The specification to the message context is enabled only when the Web Service is invoked and is not applied when the Meta data (WSDL) that occurs during the generation of the javax.xml.ws.Service class before Web Service invocation, is acquired.
    To set up basic authentication information during Meta data acquisition, specify the coding in the common definition file or process-wise definition file or separately download WSDL on the local machine and use it (when WSDL exists on the local machine is used, connection is not established with the remote machine when the Meta data is acquired). If WSDL separately imported from WSDL exists, download the imported WSDL on to the local machine.
  • If performing basic authentication or not depends on multiple Web Service clients running with the same process, do not include these properties in the process-wise definition file or common definition file and include the properties only in the message context.
    Similarly, if performing basic authentication or not depends on multiple processes running on the same system, do not include these properties in the common definition file and include the properties only in the process-wise definition file or the message context.

(2) Method of specifying the properties

For specifying the properties in the action definition file, see 10.1.2 Settings for the common definition file. For specifying the properties in the message context, see 19.2.5 Using the message context.