Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Welcome to scripting for web services > Configure web services applications using wsadmin.sh > Configure application and system policy sets for web services using wsadmin.sh
Import and exporting policy sets to client or server environments using wsadmin.sh
Use wsadmin.sh, 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 a default policy set or policy set from an archive file.
When administrative security is enabled, verify that you use the correct administrative role:
Administrative roles. This table describes the administrative roles and associated authorization when administrative security is enabled.
Administrative role Authorization Administrator The Administrator role must have cell-wide access to import and export policy sets. Configurator The Configurator role cannot import and export policy sets. Deployer The Deployer role cannot import and export policy sets. Operator The Operator role cannot import and export policy sets. Monitor The Monitor role cannot import and export policy sets. We 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. This topic provides examples for exporting a policy set, importing a policy set from an archive file, and importing a default policy set.
Procedure
- Export an 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 a policy set from an archive file or import a default policy set.
Use the importPolicySet command to import the archive file containing the policy set configuration of interest to the destination environment. We 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]')Additionally, you can also use the importPolicySet command to import a default policy set onto a server environment:
AdminTask.importPolicySet('[-defaultPolicySet SecureConversation -policySet copyOfdefaultSC]')
- Save the configuration changes.
Enter the following command to save your changes:
AdminConfig.save()
Export policy sets
Configure application and system policy sets for web services using wsadmin.sh
Delete policy sets using wsadmin.sh
Related
PolicySetManagement command group
Use wsadmin scripting with Jython