Select a policy from the Available Policies list, and click Attach. See

8-6 Oracle Fusion Middleware Security and Administrators Guide for Web Services 1. View the list of policies currently attached to the port as described in Using WLST in Viewing the Policies That are Attached to a Web Service on page 8-1. 2. View the list of available policies as described in Displaying a List of the Available Policies Using WLST on page 7-2. 3. To attach policies, do one of the following: ■ Use the attachWebServicePolicy command to attach a single policy to a Web service port. Specify the policy to be attached using the policyURI argument. If you specify a policy that is already attached or exists, then this command enables the policy if it is disabled. attachWebServicePolicyapplication, moduleOrCompName, moduleType, serviceName, subjectName, policyURI, [subjectType=None] For example, to attach the policy oraclewss_username_token_ service_policy to the WsdlConcretePort of the WsdlConcreteService, use the following command: wls:wls_domainserverConfig attachWebServicePolicywls_ domainAdminServerjaxwsejb30ws, jaxwsejb,web,WsdlConcreteService,WsdlConcretePort, oraclewss_username_token_service_policy ■ Use the attachWebServicePolicies command to attach multiple policies to a Web service port. Specify the policies to be attached using the policyURIs argument. If any of the policies that you specify in this command are already attached, then this command enables the policies that are already attached if they are disabled, and attaches the others. attachWebServicePoliciesapplication, moduleOrCompName, moduleType, serviceName, subjectName, policyURIs, [subjectType=None] For example, to attach the policies oraclewss_username_token_ service_policy and oraclewsrm10_policyto the WsdlConcretePort of the WsdlConcreteService, use the following command: wls:wls_domainserverConfig attachWebServicePolicieswls_ domainAdminServerjaxwsejb30ws, jaxwsejb,web,WsdlConcreteService,WsdlConcretePort, [oraclewss_username_token_service_policy,oraclewsrm10_policy] Please restart application to uptake the policy changes. Note: This procedure applies to Oracle Infrastructure Web services only. Attaching Policies to Web Services 8-7 4. To detach policies, do one of the following: ■ Use the detachWebServicePolicy command to detach a single policy from a Web service port. Specify the policy to be detached using the policyURI argument. detachWebServicePolicyapplication, moduleOrCompName, moduleType, serviceName, subjectName, policyURI, [subjectType=None] For example, to detach the policy oraclewss_username_token_ service_policy from the WsdlConcretePort of the WsdlConcreteService, use the following command: wls:wls_domainserverConfig detachWebServicePolicywls_ domainAdminServerjaxwsejb30ws, jaxwsejb,web,WsdlConcreteService,WsdlConcretePort, oraclewss_username_token_service_policy ■ Use the detachWebServicePolicies command to detach multiple policies from a Web service port. Specify the policies to be detached using the policyURIs argument. detachWebServicePoliciesapplication, moduleOrCompName, moduleType, serviceName, subjectName, policyURIs, [subjectType=None] For example, to detach the policies oraclewss_username_token_ service_policy and oraclewsrm10_policyto the WsdlConcretePort of the WsdlConcreteService, use the following command: wls:wls_domainserverConfig detachWebServicePolicieswls_ domainAdminServerjaxwsejb30ws, jaxwsejb,web,WsdlConcreteService,WsdlConcretePort, [oraclewss_username_token_service_policy,oraclewsrm10_policy] Please restart application to uptake the policy changes. 5. For ADF and WebCenter applications, restart the Web service application. You do not need to restart a SOA composite. Note: The policyURIs are validated through the Oracle WSM Policy Manager APIs if the wsm-pm application is installed on WebLogic Server and is available. If the policy validation fails, a message is displayed and the command is not executed. If the wsm-pm application is not installed or is not available, these commands are not executed. For additional information about validating policies, see Validating Policy Subjects on page 8-10.