Tuesday, November 12, 2013

Enabling/Disabling Policy for Composite using WLST

To disable policy set, we can use WLST as mentioned here, however could not find the WLST command to disable the policy. However, we can still disable the policy which are attached to composite, using enableWebServicePolicy.

enableWebServicePolicy(application, moduleOrCompName, moduleType, serviceName, 
subjectName, policyURI, [enable], [subjectType=None] ))

For a Composite, it would be :

application -> None
moduleOrCompName -> [partition/CompositeName[version]]
moduleType -> soa
serviceName -> from EM Console  
e.g. it would be aiaerrortaskadministrationprocess_client_ep in below screenshot


 

subjectName -> from Runtime WSDL file
e.g. It would be AIAErrorTaskAdministrationProcess_pt in below screenshot




policyURI -> from EM Console
e.g. it would be oracle/aia_wss_saml_or_username_token_service_policy_OPT_ON in below screenshot




enable -> true/false
subjectType -> None      


Below are few example to list and disable the policy attachment to services:

cd $SOA_HOME/common/bin
wlst
connect('weblogic','***','t3://admin-host:admin-port')
  
listWebServicePolicies(None, 'default/AIASessionPoolManager[1.0]','soa','client','AIASessionPoolManager')
listWebServicePolicies(None, 'default/AIAErrorTaskAdministrationProcess[1.0]', 'soa', 'aiaerrortaskadministrationprocess_client_ep', 'AIAErrorTaskAdministrationProcess_pt')
listWebServicePolicies(None, 'default/AIAAsyncErrorHandlingBPELProcess[1.0]', 'soa', 'client', 'AIAAsyncErrorHandlingBPELProcess')

enableWebServicePolicy(None, 'default/AIASessionPoolManager[1.0]', 'soa', 'client', 'AIASessionPoolManager', 'oracle/aia_wss_saml_or_username_token_service_policy_OPT_ON', false, None )
enableWebServicePolicy(None, 'default/AIAErrorTaskAdministrationProcess[1.0]', 'soa', 'aiaerrortaskadministrationprocess_client_ep', 'AIAErrorTaskAdministrationProcess_pt', 'oracle/aia_wss_saml_or_username_token_service_policy_OPT_ON', false, None )
enableWebServicePolicy(None, 'default/AIAAsyncErrorHandlingBPELProcess[1.0]', 'soa', 'client', 'AIAAsyncErrorHandlingBPELProcess', 'oracle/aia_wss_saml_or_username_or_http_token_service_policy_OPT_ON', false, None )


if you get error : "Try to use server name with application name. Multiple server targets deployed for application", refer to this blog

No comments: