Use the wsadmin tool, which supports the Jython and Jacl scripting
languages, to export and import application or system policy sets for Web
services. The exportPolicySet command creates an archive file based on the
policy set configuration, and the importPolicySet command imports the policy
set archive file into a new environment.
Before you begin
Create and configure an application or system policy set to export
to an archive file. Determine the directory where you want to create the archive
file.
About this task
You can use the exportPolicySet and importPolicySet commands to exchange
system or application policy sets between servers or between a client and
a provider. To reuse a policy set on a new server or client, export the policy
set to an archive file, then import the archive file on the destination server
or client.
Procedure
- Export the application or system policy set to an archive file.
Use the exportPolicySet command to create an archive file for the
policy set of interest. For example, the following command creates the
customSC.zip archive
file in the C:\IBM\WebSphere\AppServer\PolicySets\ directory for the customSecureConversation
policy set:
AdminTask.exportPolicySet('[-policySet customSecureConversation
-pathName C:\IBM\WebSphere\AppServer\PolicySets\customSC.zip]')
- Move the policy set archive file to the destination environment.
If you are exporting the policy set to a client environment, then
place the archive file on the classpath of the client.
- Import the archive file containing the policy set.
Use
the importPolicySet command to import the archive file containing the policy
set configuration of interest to the destination environment.
Note: You cannot
import a policy set onto a server or client environment if the policy set
already exists in the destination environment.
For example, the
following command creates a customSecureConversation policy set from the
customSC.zip archive
file:
AdminTask.importPolicySet('[-importFile C:\IBM\WebSphere\AppServer\bin\customSC.zip]')
- Save the configuration changes.
Enter the following
command to save your changes:
AdminConfig.save()
What to do next
Attach the imported policy set to Web service applications in the
destination environment.