Adding time stamps for integrity in consumer security constraints with an XPath expression

 

Before you begin

Prior to completing this task, import your application into an assembly tool. For information on how to import your application, see Import enterprise applications.

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. We 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.

 

Overview

This task is to specify that a time stamp is expected to be added in an element of the SOAP message that is specified by the XPath language syntax. The element is expected to be signed with the message part that is specified in the Required Integrity Dialog window. Complete the following steps to specify the time stamp for integrity using an XPath expression 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.

 

Procedure

  1. Start the assembly tool and click Window > Open Perspective > J2EE.

  2. 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 we need to configure.

    1. Expand the Web Services > Client section and double-click the name of the Web service.

    2. Click the WS Extension tab and expand the Response Consumer Configuration section.

  3. 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 we need to configure.

    1. Expand the Web Services > Services section and double-click the name of the Web service.

    2. Click the Extensions tab and expand the Request Consumer Service Configuration Details section.

  4. Expand the Required Integrity section. Integrity refers to digital signature while confidentiality refers to encryption. Integrity decreases the risk of data modification when you transmit data across a network. For more information on digitally signing SOAP messages, see XML digital signature.

  5. Click Add to specify a time stamp for integrity. The Required Integrity Dialog window is displayed.

    1. Specify a name for the integrity element in the Required Integrity Name field.

    2. Specify a usage type in the Usage type field. This field specifies the requirement for the integrity element. The value of this attribute is either Required or Optional.

  6. Click Add in the Timestamp section of the Required Integrity Dialog window.

    1. Select the Timestamp dialect from the Timestamp section. The http://www.w3.org/TR/1999/REC-xpath-19991116 dialect specifies the message part to which the time stamp is added and signed using the XPath expression.

    2. Select the message part in the Timestamp keyword field to which the time stamp is added and signed using an XPath expression. For example, to specify that the time stamp is added to the body and is signed, you might specify the following expression for the Timestamp keyword

      /*[namespace-uri()='http://schemas.xmlsoap.org/soap/envelope/' 
      and local-name()='Envelope']/*[namespace-uri()='http://schemas.xmlsoap.org/
      soap/envelope/' and local-name()='Body']
      

      Important: Verify that your XPath expression syntax is correct.

  7. If you have not previously defined a message part in the Required Integrity Dialog window, click Add under the Message Parts section and define a message part.

  8. In the Message Parts section, select the message parts keyword.

  9. Click OK to save the configuration changes.

    Note: These configurations for the consumer and the generator must match.

    In addition to the time stamp, one can specify that the nonce is signed. For more information, see the following articles:

    Important: You must define one message part in the required integrity if you want to use the time stamp feature for required integrity.

 

What to do next

After you have specified which message parts to digitally sign, you must specify which method is used to digitally sign the message. For more information, see Configuring signing information for the consumer binding with an assembly tool.


 

Related Tasks


Adding a stand-alone time stamp in consumer security constraints
Adding a nonce for integrity in consumer security constraints with an XPath expression
Configuring signing information for the consumer binding with an assembly tool
Adding a nonce for integrity in consumer security constraints with keywords