+

Search Tips   |   Advanced Search

Set the client.policy using a service provider policy


An application that is a Web service client can obtain the policy configuration of a Web service provider and use this information to establish a policy configuration that is acceptable to both the client and the service provider.

Overview

we have developed a Web service client that contains all the necessary artifacts, and deployed the Web services application into the appserver instance. If we require them, we have attached the policy sets and managed the associated bindings.

The service provider must publish its policy in its Web Services Description Language (WSDL) and that policy must contain its policy configuration at run time in WS-PolicyAttachments format. The client must be able to support those provider policies.

For a list of WS-Policy assertion specifications and WS-Policy domains that are supported, see Learn about WS-Policy.

We can administer the client to configure itself dynamically at run time, based on the policy of the service provider in the standard WS-PolicyAttachments format. You can administer the client to apply dynamically the provider policy at the application or service level. Endpoints and operations inherit their policy configuration from the relevant service.

If the provider policy uses multipart WSDL, we can use an HTTP Get request to obtain the policy of the provider, but we cannot use the WS-MetadataExhange protocol.

See about multipart WSDL, see the topic about WSDL.

Policy intersection is the comparison of a client policy and a provider policy to determine whether they are compatible, and the calculation of a new policy, known as the effective policy, that complies with both their requirements and capabilities.

This topic describes how to configure the client.policy to use a service provider policy by using the admin console. We can also configure the client.policy to use a service provider policy by using wsadmin commands.

 

  1. From the navigation pane of the admin console, click Applications > Application Types > WebSphere enterprise apps > service_client_application_instance > [Web services properties] Service client.policy sets and bindings.

  2. In the row for the application or service where you want to apply the policy, click the link in the Policies Applied column.

    The Policies Applied pane is displayed.

  3. Select one of the following options from the drop-down list:

    • Provider policy only. Set the client based solely on the policy of the service provider. This option is available when a client.policy set is not attached.

    • Client and provider policy. Set the client based on both the client.policy set and the policy of the service provider. This option is available when a client.policy set is attached.

    The other options in the list do not apply to this task.

  4. To obtain the provider policy using an HTTP Get request, click HTTP GET request. By default, the HTTP Get request is targeted at the URL for the service endpoint followed by ?WSDL. For example:

    http://myhost:9082/WSSampleSei/EchoService/WEB-INF/wsdl/Echo.wsdl?WSDL
    

    When you apply a policy to an application, we cannot change this value.

    1. If applying a policy to a service and the provider policy is located at the service endpoint, ensure that Use the default request target is selected.

    2. If applying a policy to a service and the provider policy is not located at the service endpoint, click Specify request target, then enter the URL for the location of the provider policy in the field. For example, we might change the target of the HTTP Get request if the provider policy is located in a repository.

  5. To obtain the provider policy using a Web Services Metadata Exchange (WS-MetadataExchange) GetMetadata request, click WS-MetadataExchange request.

  6. If we select WS-MetadataExchange request and you want to use message-level security, select Attach a system policy set to the WS-MetadataExchange, then select a suitable policy set and binding from the drop-down lists. See Set security for a WS-MetadataExchange request.

  7. Click OK.

  8. Save the changes to the master configuration.

 

Results

The Web app client-side policy is calculated when it is required at run time, based either on the policy of the service provider, or on the client.policy set and the policy of the service provider, depending on which option you selected. This calculated policy is known as the "effective policy" and is cached as a runtime configuration. The effective policy is used for subsequent outbound Web service requests to the endpoint or operation for which the dynamic policy calculation was performed. The policy set configuration of the client does not change.

The provider policy that the client holds for a service is refreshed the first time that the Web service is invoked after the application is loaded. After that, the provider policy is refreshed when the application restarts, or if the application explicitly invokes a refresh. When the provider policy is refreshed, the effective policy is recalculated.


Set the client.policy based on a service provider policy using wsadmin
Policies applied settings

 

Related concepts


Web service clients and policy configuration using the service provider policy
WSDL

 

Related tasks


Learn about WS-Policy
Deploy Web services applications onto appservers
Manage policy sets and bindings for service clients at the application level
Set a service provider to share its policy configuration
Set security for a WS-MetadataExchange request
Use WS-Policy to exchange policies in a standard format