setClientDynamicPolicyControl command
Use the setClientDynamicPolicyControl command to set how an application that is a web services client obtains the policy configuration of a web services provider. We can set, refresh, or remove this information about how a provider policy is obtained.
To run the command, use the AdminTask object of the wsadmin scripting client.
(iseries) The wsadmin scripting client is run from Qshell. For more information, see the topic "Configure Qshell to run WebSphere Application Server scripts".
This command is valid only when it is used with WebSphere Application Server Version 7 and later application servers. Do not use it with earlier versions.
For a list of the available policy set management administrative commands, plus a brief description of each command, enter the following command at the wsadmin prompt:
print AdminTask.help('PolicySetManagement')
For overview help on a given command, enter the following command at the wsadmin prompt:
print AdminTask.help('command_name')
After using the command, save the changes to the master configuration. For example, use the following command:
AdminConfig.save()
Purpose
Use the setClientDynamicPolicyControl command to set how a client obtains the policy configuration of a service provider.
The client can obtain the policy configuration of the provider through a Web Services Metadata Exchange (WS-MetadataExchange) request or through an HTTP GET request. The service provider must publish its policy in WS-PolicyAttachment format in its WSDL and the client must be able to support those provider policies.
At run time, the client uses the information to establish a policy configuration that is acceptable to both the client and the service provider.
Target object
An application or service that is a web services client.
Required parameters
- -applicationName
- The name of the application for which to obtain the policy configuration of the provider. (String)
- -resource
- The name of the resource for which to obtain the policy configuration of the provider. For all resources in an application, specify WebService:/. Alternatively, we can specify a service or service reference .
- See the Configure the client policy to use a service provider policy by topic for further details.
Optional parameters
- -acquireProviderPolicyMethod
- How the policy configuration of the provider can be obtained. (String)
Enter one of the following values:
- httpGet
- Obtain the policy configuration of the provider by using an HTTP GET request.
By default, the HTTP GET request is targeted at the URL for each service endpoint followed by ?WSDL. If we specify a service for the resource parameter, and to specify a different location for the policy configuration of the provider, we can use the httpGetProperties parameter to change the target of the request.
By default, the HTTP GET request uses the same HTTP and SSL transport policies as the application request. If we use the httpGetProperties parameter to change the target of the request, and to specify different HTTP and SSL transport policies for the request, we can specify the system policy set and general binding containing the HTTP and SSL transport policies you require.
- wsMex
- Obtain the policy configuration of the provider by using a WS-MetadataExchange request.
By default, the WS-MetadataExchange request inherits the policy set and binding configuration from the application. We can specify the system policy set and general binding containing the WS-Security policies you require.
- -wsMexProperties
- Specifies that message-level security is required for WS-MetadataExchange requests and specifies the settings that provide the message-level security. (Properties)
Enter the following values, following each value with the setting that you require for that value:
- wsMexPolicySetName
- The name of the system policy set that specifies message-level security for a WS-MetadataExchange request. Specify a system policy set containing only WS-Security policies, only WS-Addressing policies, or both.
- wsMexPolicySetBinding
- The name of the general binding for the policy set attachment for a WS-MetadataExchange request. Specify a general binding that is scoped to the global domain, or scoped to the security domain of this service. If we do not specify this property, the default binding is used.
This value is valid only when specified the wsMexPolicySetName value.
This parameter is valid only when specified wsMex for the acquireProviderPolicyMethod parameter.
- -httpGetProperties
- Target for acquiring provider policy by using an HTTP GET request if the provider policy is at a different location from the target endpoint. Optionally specifies the system policy set and general binding containing the HTTP and SSL transport policies you require. (Properties)
Enter the following values, followed by the setting that you require for each value:
- httpGetTargetURI
- The URL for the location of the provider policy. For example, the location might refer to policy held in a registry.
- httpGetPolicySetName
- The name of the system policy set containing the HTTP and SSL transport policy to use for the HTTP GET request. If the specified system policy set contains policy types other than HTTP and SSL transport, these additional policy types are ignored.
This value is valid only when specified the httpGetTargetURI value.
- httpGetPolicySetBinding
- The name of the general binding containing the HTTP and SSL transport bindings for the HTTP GET request. If we do not specify this property, the default binding is used.
This value is valid only when specified the httpGetPolicySetName value.
This parameter is valid only when specified httpGet for the acquireProviderPolicyMethod parameter and the resource is a service. Do not use this parameter if the resource is an application.
- -remove
- Whether to remove the information about how the client obtains the policy configuration of the provider. (Boolean)
This parameter takes the following values:
- true
- Information about how the client obtains the policy configuration of the provider is removed.
- false
- Default. Information about how the client obtains the policy configuration of the provider is not removed.
Examples
The following example removes the information about how the client obtains the policy configuration of the provider from the EchoService service of the WSPolicyClient client application.
AdminTask.setClientDynamicPolicyControl('[-applicationName WSPolicyClient -resource WebService:/WSPolicyClient.war:{http://example_path/}EchoService -remove true]')
The following example configures the EchoService service of the WSPolicyClient client application to obtain the policy configuration of the provider by using an HTTP GET request.
AdminTask.setClientDynamicPolicyControl('[-applicationName WSPolicyClient -resource WebService:/WSPolicyClient.war:{http://example_path/}EchoService -acquireProviderPolicyMethod [httpGet ] -httpGetProperties [httpGetTargetURI http://example_path]]')
The following example configures the EchoService service of the WSPolicyClient client application to obtain the policy configuration of the provider by using an HTTP GET request. The request uses the HTTP and SSL transport policies contained in the SystemWSSecurityDefault policy set and the "Client sample" general binding.
AdminTask.setClientDynamicPolicyControl('[-applicationName WSPolicyClient -resource WebService:/WSPolicyClient.war:{http://example_path/}EchoService -acquireProviderPolicyMethod [httpGet ] -httpGetProperties [ [httpGetTargetURI http://example_path] [httpGetPolicySetName SystemWSSecurityDefault] [httpGetPolicySetBinding [Client sample]] ]]')
The following example configures the EchoService service of the WSPolicyClient client application to obtain the policy configuration of the provider through a WS-MetadataExchange request with message-level security, using the SystemWSSecurityDefault policy set and the "Client sample" general binding.
AdminTask.setClientDynamicPolicyControl('[-applicationName WSPolicyClient -resource WebService:/WSPolicyClient.war:{http://example_path/}EchoService -acquireProviderPolicyMethod [wsMex ] -wsMexProperties [ [wsMexPolicySetName [SystemWSSecurityDefault]] [wsMexPolicySetBinding [Client sample]] ]]')
Related tasks
Configure the client policy to use a service provider policy by Create policy sets Configure general, cell-wide bindings for policies Use the wsadmin scripting AdminTask object for scripted administration Start the wsadmin scripting client
getProviderPolicySharingInfo command setProviderPolicySharingInfo command getClientDynamicPolicyControl command