You can add security to a web service client by attaching
policy sets to the client. Each attachment specifies an endpoint,
a policy set, and a binding. Because each configuration is specific
to an application and a user, you must configure a binding for some
policy types.
For a given web service and a client of that service, the
policy sets and bindings configuration must match for the service
to function correctly.
- In the Java EE perspective Services view expand the JAX-WS
web services node. Select the address book client, right-click and
select Manage Policy Set Attachment.
- Ensure that the jwsAddressBookEAR is selected, and click Next.
- In the Application section, click Add to
attach a policy set to the endpoint and specify the bindings.
- Since the service is secured at the service level rather
than the endpoint or operation level, the client will be secured at
this level as well. Select the AddressBookService from the Service
Name drop-down list and leave the Endpoint and Operation Name fields
empty.
- In the Policy Set field, select WS-I RSP from the list.
- In the Binding field ensure Client Sample is
selected. This is a client-side general binding packaged with WebSphere
Application Server.
- Click OK.
- The policy types contained by the policy set you selected
are listed in the Bindings Configuration table. The configuration
for these policy types are already complete.
- Click Finish to complete the wizard.
clientPolicyAttachments.xml is created
in the META-INF folder of the jwsAddressBookEAR,
as well as the client side bindings.