Use the setClientDynamicPolicyControl command to set how an application that is a web services client obtains the policy configuration of a web services provider. You 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.
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.
print AdminTask.help('PolicySetManagement')
print AdminTask.help('command_name')
AdminConfig.save()
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 Web Services Description Language (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.
An application or service that is a web services client.
By default, the HTTP GET request is targeted at the URL for each service endpoint followed by ?WSDL. If you specify a service for the resource parameter, and you want to specify a different location for the policy configuration of the provider, you 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 you use the httpGetProperties parameter to change the target of the request, and you want to specify different HTTP and SSL transport policies for the request, you can specify the system policy set and general binding that contains the HTTP and SSL transport policies you require.
By default, the WS-MetadataExchange request inherits the policy set and binding configuration from the application. You can specify the system policy set and general binding that contains the WS-Security policies you require.
This value is valid only when you specify the wsMexPolicySetName value.
This parameter is valid only when you specify wsMex for the acquireProviderPolicyMethod parameter.
This value is valid only when you specify the httpGetTargetURI value.
This value is valid only when you specify the httpGetPolicySetName value.
This parameter is valid only when you specify httpGet for the acquireProviderPolicyMethod parameter and the resource is a service. Do not use this parameter if the resource is an application.
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, by 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]] ]]')