setProviderPolicySharingInfo command
Use the setProviderPolicySharingInfo command to set how an application or service that is a web service provider can share its policy configuration with other clients, service registries, or services that support the WS-Policy specification. You can set or remove this information about how a provider policy is shared.
如果要執行這個指令,請使用 wsadmin Scripting 用戶端的 AdminTask 物件。
wsadmin Scripting 用戶端是從 Qshell 執行的。
如需相關資訊,請參閱「配置 Qshell 執行 WebSphere® Application Server Script」主題。
只有在搭配 WebSphere Application Server 第 7 版及版本更新的應用程式伺服器時,這個指令才有效。請勿搭配較舊的版本來使用它。
print AdminTask.help('PolicySetManagement')
print AdminTask.help('command_name')
AdminConfig.save()
Purpose
Use the setProviderPolicySharingInfo command to set how an application, or a service in an application, shares its policy configuration with clients, service registries, or services that support the WS-Policy specification. The policy configuration is shared in WS-PolicyAttachments format.
The policy configuration of the resource can be shared with clients through a WS-MetadataExchange request, through Web Services Description Language (WSDL) exported by a ?WSDL HTTP Get request, or through both methods.
Target object
None.
Required parameters
- -applicationName
- The name of the application for which you want to set how the provider policy is shared. (String)
- -resource
- The name of the resource for which you want to set how the provider policy is shared. For all resources in an application, specify WebService:/. For a service in an application, specify WebService:/module:{namespace}service_name. Endpoints or operations inherit the settings of the parent application or service. (String)
Optional parameters
- -sharePolicyMethods
- Specifies how the policy configuration of the resource can be
shared. (String array)Enter either or both of the following values:
- httpGet
- The resource can share its policy configuration through WSDL that is obtained by a ?WSDL HTTP Get request.
- wsMex
- The resource can share its policy configuration through a WS-MetadataExchange request.
- -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 when the resource shares its policy configuration through a WS-MetadataExchange request. Specify a system policy set that contains only WS-Security policies, only WS-Addressing policies, or both. The default policy set is SystemWSSecurityDefault.
- wsMexPolicySetBinding
- The name of the general binding for the policy set attachment when the resource shares its policy configuration through 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 you do not specify this property, the default binding is used.
This parameter is valid only when you specify wsMex for the sharePolicyMethods parameter.
- -remove
- Specifies
whether the information about how the provider policy
is shared is removed from the resource. (Boolean)This parameter takes the following values:
- true
- The information about how the provider policy is shared is removed from the resource.
- false
- This value is the default. The information about how the provider policy is shared is not removed from the resource.
Examples
The following example removes the information about how the provider policy is shared from the WSSampleServices application:
AdminTask.setProviderPolicySharingInfo('[-applicationName WSSampleServices
-resource WebService:/ -remove true]')
The following example enables policy sharing, using WSDL exported by a ?WSDL HTTP Get request, for the EchoService service in the WSSampleServices application:
AdminTask.setProviderPolicySharingInfo('[-applicationName WSSampleServices
-resource WebService:/WSSampleServicesSei.war:{http://example_path/}EchoService
-sharePolicyMethods [httpGet ]]')
The following example enables policy sharing, using a WS-MetadataExchange request with message-level security, for the WSSampleServices application. Message level security is provided by the SystemWSSecurityDefault policy set and the "Provider sample" general binding.
AdminTask.setProviderPolicySharingInfo('[-applicationName WSSampleServices
-resource WebService:/ -sharePolicyMethods [wsMex ]
-wsMexProperties [ [wsMexPolicySetName [SystemWSSecurityDefault]]
[wsMexPolicySetBinding [Provider sample]] ]]')