1.1.2.2 Using WS-Policy Files

Advanced Web service features can be enabled by configuring WS-Policy files (for example, Reliable Messaging and Web Service Message-Level Security). You may need to create WS-Policy files to use these features. The Web Service Policy Framework specifications Web Service Policy Framework specifications provides a general purpose model and syntax to describe and communicate the policies of a Web Service.

To use WS-Policy files, the <Policy> element should be defined in the WSDF to incorporate these separate WS-Policy files. The location attribute is used to specify the policy file path; both abstract and relative file path are allowed. The use attribute is optionally used by message-level assertion policy files to specify the applied messages, request (input) message, response (output) message, fault message, or the combination of the three.

There are two different sub-elements in the WSDF that reference WS-Policy files:

  • <Servicegroup>
    • If a WS-Policy file consists of Web Service Endpoint-level Assertions (for example, Reliable Messaging Assertion), the WS-Policy file applies to all endpoints serving the <Servicegroup> element
    • If a WS-Policy file consists of Web Service Operation-level Assertions (for example, Security Identity Assertion), the WS-Policy file applies to all services listed in the <Servicegroup> element.
    • If a WS-Policy file consists of Web Service Message level Assertions (for example, Security SignedParts Assertion), the WS-Policy file applies to input, output and/or fault messages of all services listed in the <Servicegroup> element.

      Note:

      only supports request message-level assertions for the current release. You must only specify use=”input” for message=level assertion policy files.
  • <Service>
    • If a WS-Policy file consists of Web Service Operation-level Assertions (for example, Security Identity Assertion), the WS-Policy file applies to this particular service.
    • If a WS-Policy file consists of Web Service Message-level Assertions, (for example, Security SignedParts Assertion), the WS-Policy file applies to input, output and/or fault messages of this particular service.

      Note:

      SALT only supports request message-level assertions for the current release. You must specify use=”input” for message-level assertion policy files.

SALT provides some pre-packaged WS-Policy files for most frequently used cases. These WS-Policy files are located under directory $TUXDIR/udataobj/salt/policy. These files can be referenced using location=”salt:<policy_file_name>

Following is an example of a sample of using WS-Policy Files in the native WSDF file.

Example 1-7 A Sample of Defining WS-Policy Files in the WSDF File

<Definition ...>
  <WSBinding id="simpapp_binding">
    <Servicegroup id="simpapp">
      <Policy location=”./endpoint_policy.xml” />
      <Policy location=”/usr/resc/all_input_msg_policy.xml” use=”input” />
      <Service name="toupper">
        <Policy location=”service_policy.xml” />
        <Policy location=”/usr/resc/input_message_policy.xml”
                use=”input” />
      </Service>
      <Service name="tolower" />
    </Servicegroup>
    ....
  </WSBinding>
</Definition>

For more information, see Specifying the Reliable Messaging Policy File in the WSDF File and Using WS-Security Policy Files