P6 EPPM Web Services uses an external attachment file to support WS-Policy. Since the reference to the external file is commented out in the default P6 EPPM Web Services installation, WS-Policy for P6 EPPM Web Services is disabled by default. However, you can enable WS-Policy by uncommenting the reference to the external file before deploying P6 EPPM Web Services to the server.
The external file, policies.xml, requires HTTPS and WS-Addressing for P6 EPPM Web Services. However, if you want to remove either of these requirements from a P6 EPPM Web Services, you can customize WS-Policy by removing the HTTPS and/or WS-Addressing sections for that service from the external attachment file.
To enable and customize WS-Policy:
Extract the cxf.xml and policies.xml files from the p6ws.ear file.
Navigate to the p6ws.ear file and use this command to extract to extract the p6ws.war file:
jar xf p6ws.ear p6ws.war
Execute the following commands to extract the cxf.xml and policies.xml files from the p6ws.war file:
jar xf p6ws.ear WEB-INF/classes/cxf.xml
jar xf p6ws.ear WEB-INF/classes/policies.xml
To uncomment the reference in the cxf.xml file to the external attachment file:
Open the cxf.xml file in a text editor.
Find following line in the cxf.xml file:
<!-- <ref bean="policyIn" /> -->
Uncomment this line by removing the the beginning and the end of the comment tag:
Remove the lines beginning with <!-- and --> to uncomment the external file reference.
Find following lines in the cxf.xml file:
<!-- <p:policies/> -->
Uncomment this line by removing the the beginning and the end of the comment tag:
<p:policies/>
Customize the policies.xml file.
Open the policies.xml in a text editor.
Customize the HTTPS Policy definitions section. For example, to remove the requirement to use HTTPS with the Spread service, remove these lines from the HTTPS Policy definitions section of the policies.xml file:
<wsa:EndpointReference>
<wsa:Address>/SpreadService</wsa:Address>
</wsa:EndpointReference>
Customize the WS Addressing Policy definitions section. For example, to remove the requirement to use WS Addressing with the Spread service, remove the following lines from the WS Addressing Policy definitions section of the policies.xml file:
<wsa:EndpointReference>
<wsa:Address>/SpreadService</wsa:Address>
</wsa:EndpointReference>
Update the p6ws.ear file with the new cxf.xml file and policies.xml files.
Ensure that you are in the same directory as the p6ws.ear file.
Use the following commands to update the p6ws.war file:
jar uf p6ws.war WEB-INF/classes/cxf.xml
jar uf p6ws.war WEB-INF/classes/policies.xml
Use the following command to update the p6ws.ear file with updated the p6ws.war file:
jar uf p6ws.ear p6ws.war
Delete the p6ws.war file and the WEB-INF directory.
Tips
The default policies.xml file is separated into two sections:
The top section contains policy expressions for requiring HTTPS connections from clients.
The bottom section contains policy expressions for requiring WS-Addressing (WS-Addressing is configured using the <Addressing> policy expression).