Encrypting message elements in consumer security constraints with an XPath expression
The following information explains the difference between using an XPath expression and using keywords to specify which part of the message to sign:
- XPath expression
- Specify any part of the message using an XPath expression. XPath is a language that is used to address parts of an XML document. You can find information on XPath syntax at the following Web site: http://www.w3.org/TR/1999/REC-xpath-19991116.
- Keywords
- Specify only elements within the message using predefined keywords.
Complete the following steps to specify which message parts to check for encryption when you configure the consumer security constraints for either the response consumer or the request consumer. The response consumer is configured for the client and the request consumer is configured for the server. In the following steps, configure either the client-side extensions in step 2 or the server-side extensions in step 3.
- Click Window > Open Perspective > J2EE.
- Optional:
Locate the client-side extensions using the Project Explorer window. The Client Deployment Descriptor window is displayed. This Web service contains the extensions that you need to configure. Complete the following steps to locate the client-side extensions:
- Expand the Web Services > Client section and double-click the name of the Web service.
- Click the WS Extension tab and expand the Response Consumer Configuration section.
- Optional:
Locate the server-side extensions using the Project Explorer window. The Web Services Editor window is displayed. This Web service contains the extensions that you need to configure. Complete the following steps to locate the server-side extensions:
- Expand the Web Services > Services section and double-click the name of the Web service.
- Click the Extensions tab and expand the Request Consumer Service Configuration Details section.
- Expand the Required Confidentiality section. Confidentiality refers to encryption while integrity refers to digital signing. Confidentiality reduces the risk of someone intercepting the message as it moves across a network. With confidentiality specifications, the message is encrypted before it is sent and decrypted when it is received at the intended target. For more information on encryption, see XML encryption.
- Click Add to specify which parts of the message to check for encryption. The Required Confidentiality Dialog window is displayed. Complete the following steps to specify a configuration:
- Specify a name for the confidentiality element in the Required Confidentiality Name field.
- Specify a usage type in the Usage type field. This field specifies the requirement for the confidentiality element. The value of this attribute is either Required or Optional.
- Click Add under the Message parts section of the Required Confidentiality Dialog window. Complete the following steps to specify the message part and its associated message parts dialect:
- Select the message parts dialect from the Message parts section. The http://www.w3.org/TR/1999/REC-xpath-19991116 dialect specifies which message part is checked for encryption using an XPath expression.
- Specify the message part to be checked for encryption using an XPath expression in the Message parts keyword field. For example, to specify that the body is checked for encryption, you might add the following expression in the Message parts keyword field as one continuous line:
/*[namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Envelope']/* [namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/' and local-name()='Body']
Note: These configurations for the consumer and the generator must match.
In addition to the message parts, you also can specify that WebSphere® Application Server check the nonce and timestamp elements for encryption. For more information, see the following articles:
- Adding time stamps for confidentiality in consumer security constraints with keywords
- Adding time stamps for confidentiality in consumer security constraints with an XPath expression
- Adding a nonce for confidentiality in consumer security constraints with keywords
- Adding the nonce for confidentiality in consumer security constraints with an XPath expression
- Click OK to save your configuration.
After you specify which message parts to check for encryption, you must specify which method is used to verify the encryption of the message parts. For more information, see Configuring encryption information for the consumer binding.
- Adding time stamps for confidentiality in consumer security constraints with an XPath expression
- Adding the nonce for confidentiality in consumer security constraints with an XPath expression
Related tasks
Adding time stamps for confidentiality in consumer security constraints with keywords
Adding a nonce for confidentiality in consumer security constraints with keywords
Configuring encryption information for the consumer binding