+

Search Tips   |   Advanced Search

Set a service provider to share its policy configuration using wsadmin


A WAS service provider can share its policy configuration in published Web Services Description Language (WSDL), or WSDL that is obtained using an HTTP Get request or the Web Services Metadata Exchange (WS-MetadataExchange) GetMetadata request. we have developed a Web services service provider that contains all the necessary artifacts and deployed the Web services application into the appserver instance. You have attached the policy sets and managed the associated bindings.

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

We can make the policy configuration of a JAX-WS service endpoint available to share in two ways:

The policy configuration in the WSDL is in the standard WS-PolicyAttachments format. Any WS-Policy attachments that were in the WSDL previously are removed. Note that policy configuration information becomes available in the WSDL to publish, but it is not available if we just view the WSDL document using the admin console. Also, policy configuration information is not available in WSDL that is published remotely by using an administrative agent.

If the service provider application uses multipart WSDL, all the WSDL must be local to the Web service application.

See about multipart WSDL, see the topic about WSDL.

You must configure a service provider to share its policy configuration because by default the policy configuration is not available in its WSDL. Configure the service provider to include the policy configuration in its WSDL, to use WS-MetadataExchange so that the policy configuration is available, or both. This topic describes how to configure a service provider to share its policy configuration using wsadmin commands. We can also use the admin console or Rational Application Developer (RAD) tools.

Configure a service provider to share its policy configuration at application or service level. The policy configuration that is represented by the policy sets attached to any lower levels will also be shared. Policy sets that are attached at lower levels override the policy set configuration attached at a higher level.

 

  1. Start wsadmin if it is not already running.

  2. Use the SetProviderPolicySharingInfo command.

    For example:

    AdminTask.setProviderPolicySharingInfo('[-applicationName WebServiceProviderApplication -resource WebService:/WebServiceProvider.war:{http://example_path/}Service1 -sharePolicyMethods [httpGet ]]')

  3. Save the changes to the master configuration.

    To save the configuration changes...

    AdminConfig.save()

 

Results

The policy configuration of the service provider is available to its clients. The WSDL of the service provider contains the current policy configuration in WS-PolicyAttachments format so that it is available to other clients, service registries, or services that support the Web Services Policy (WS-Policy) specification.If the policy configuration cannot be shared, an error that describes the problem is written to the service provider error log, and the following policy is attached to the WSDL of the service provider:

<wsp:Policy>
<wsp:ExactlyOne>
</wsp:ExactlyOne>
</wsp:Policy>
This policy notifies the client that there is no acceptable policy configuration for the service. Other aspects of the WSDL are unaffected.

A service provider might not be able to share its policy configuration because the configuration cannot be expressed in the standard WS-PolicyAttachments format. One reason might be because multiple incompatible policies are defined for a particular attach point. Another reason might be because there is not enough binding information to generate the standard policy. Policy configuration might include bootstrap policy, for example, the policy to access a WS-Trust service, so the bootstrap policy must also be expressed in WS-PolicyAttachments format.

 

Next steps

Optionally, we can publish the WSDL files.

 

Related concepts


Web service providers and policy configuration sharing
WS-MetadataExchange requests
WSDL

 

Related tasks


Use WS-Policy to exchange policies in a standard format
Learn about WS-Policy
Set security for a WS-MetadataExchange request
Deploy Web services applications onto appservers
Set the client.policy based on a service provider policy using wsadmin
Publishing WSDL files using wsadmin
View WSDL document
Start wsadmin
Set a service provider to share its policy configuration

 

Related


WS-Policy commands for AdminTask
setProviderPolicySharingInfo