Nonce for integrity is used to specify that a nonce be embedded
in a particular element within the message and that the element be signed.
You can specify a nonce for integrity by using an XPath expression when you
configure the consumer security constraints for either the response consumer
or the request consumer.
Before you begin
Prior to completing this task, you must import your application into
an assembly tool.
For information on how to import
your application, see Importing
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. 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.
About this task
Complete the following steps to specify a nonce 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, you must configure either the client-side
bindings in step 2 or the server-side bindings in step 3.
Procedure
- Start the assembly tool and click Window > Open Perspective
> J2EE.
- Optional: Locate the client-side bindings 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 bindings:
- 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 bindings using the
Project Explorer window. The Web Services Editor window is displayed.
This Web service contains the bindings that you need to configure. Complete
the following steps to locate the server-side bindings:
- 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 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
.
- Click Add to specify a nonce for integrity. The
Required Integrity Dialog window is displayed. Complete the following steps
to specify a configuration:
- Specify a name for the integrity element in the Required Integrity
Name field.
- 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.
- Click Add in the Nonce section of the Required Integrity
Dialog window. Complete the following steps to configure the nonce
dialect and message part:
- Select the Nonce dialect from the Nonce section. The XML
Path Language (XPath) dialect specifies the message part to which a
nonce is added and signed using an XPath expression.
- Select the message part in the Nonce keyword field to which
a nonce is added and signed using an XPath expression. For example,
to specify that a nonce is added to the body and that it is signed, you might
specify the following expression for the Nonce 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']
- In the Message Parts section, click Add and select http://www.w3.org/TR/1999/REC-xpath-19991116 in
the Message parts dialect field.
- In the Message Parts section, select the message parts keyword.
Important: You must select the same keyword in the Message
parts keyword field as the keyword that you selected in the Nonce keyword
field.
- Click OK to save the configuration changes.
Note: These
configurations on the consumer side and the generator side must match.
In
addition to the nonce, you can specify that the timestamp element is signed.
For more information, see the following articles: