Consuming P6 EPPM Web Services over HTTPS (SSL) Using Username Token Profile

Consuming P6 EPPM Web Services over the Secure Sockets Layer involves several steps:

  1. Setting up the application server to use SSL
  2. Creating client code that sets up and uses an SSL connection

The following additions in bold to the demo source provide an example of how you could implement client code that sets up and uses an SSL connection.

Note: The following snippet is for example purposes only and does not include all of the changes that would need to be made to the demo source to successfully use SSL with the demo.

private int readEPS()

throws Exception

{

String url = makeHttpURLString(m_demoInfo.hostname, m_demoInfo.port, EPS_SERVICE);

URL wsdlURL = new URL(url);

EPSService service = new EPSService(wsdlURL);

EPSPortType servicePort = service.getEPSPort();

Client client = ClientProxy.getClient(servicePort);

//..Set up and use an SSL connection

HTTPConduit httpConduit = (HTTPConduit)client.getConduit();

TLSClientParameters tlsParams = new TLSClientParameters();

tlsParams.setSecureSocketProtocol("SSL");

httpConduit.setTlsClientParameters(tlsParams);

//..

List<EPSFieldType> epsFields = new ArrayList<EPSFieldType>();

epsFields.add(EPSFieldType.OBJECT_ID);

epsFields.add(EPSFieldType.ID);

epsFields.add(EPSFieldType.NAME);

// ParentObjectId will be null for all root level EPS

List<EPS> EPSs = servicePort.readEPS(epsFields, "ParentObjectId is null", null);

if ((EPSs == null) || (EPSs.size() == 0))

{

System.out.println("No EPS node available");

return 0;

}

else

{

return EPSs.get(0).getObjectId().intValue();

}

}



Legal Notices | Your Privacy Rights
Copyright © 2008, 2023

Last Published Thursday, January 12, 2023