Configuring the client policy to use a service provider policy by using wsadmin scripting

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.

Before you begin

You have developed a Web service client that contains all the necessary artifacts, and deployed your Web services application into your application server instance. If you require them, you 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 the topic about learning about WS-Policy.

About this task

You 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, you can use an HTTP Get request to obtain the policy of the provider, but you cannot use the WS-MetadataExhange protocol. For more information 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 wsadmin commands. You can also configure the client policy to use a service provider policy by using the administrative console.

Procedure

  1. Start the wsadmin scripting client if it is not already running.
  2. Use the SetClientDynamicPolicyControl command. For example:
    AdminTask.setClientDynamicPolicyControl('[-applicationName WebServiceClientApplication 
    -resource WebService:/ClientApplication.war:{http://example_path/}Service1 
    -acquireProviderPolicyMethod [httpGet ] 
    -httpGetProperties [httpGetTargetURI http://example_path]]') 
  3. Save your changes to the master configuration.
    To save your configuration changes, enter the following command:
    AdminConfig.save()

Results

The Web application 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.




In this information ...


IBM Redbooks, demos, education, and more

(Index)

Use IBM Suggests to retrieve related content from ibm.com and beyond, identified for your convenience.

This feature requires Internet access.

Task topic    

Terms of Use | Feedback

Last updated: Oct 20, 2010 9:57:58 PM CDT
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-base-dist&topic=twbs_wsp_client_sppw
File name: twbs_wsp_client_sppw.html