Advanced Customization > Info*Engine User’s Guide > SOAP Services > Info*Engine Java EE Connector > JCA Contracts and the Common Client Interface > Common Client Interface (CCI)
  
Common Client Interface (CCI)
* 
Interactions with Info*Engine should ideally be performed through generated Data Access Objects (DAOs) rather than at the CCI level. For more information on DAO generation, see Example Standalone Java SOAP Client.
The Info*Engine Java EE connector avoids a proprietary API for interaction by implementing the Common Client Interface (CCI).
The CCI simplifies the problem of writing code to connect a client to an underlying EIS’s data store. The EIS vendor can use the CCI to write a generic interface to its product. With this one interface, the product works with clients on any Java EE compliant platform. Likewise, application developers only need to learn and use one set of API calls to connect their client to any underlying EIS, rather than having to learn a different API for each EIS.
The following classes are used by the CCI:
com.infoengine.connector.IeConnectionSpec
com.infoengine.connector.IeInteractionSpec
com.infoengine.connector.IeInteractionResult
com.infoengine.connector.IeConnectionSpec
The com.infoengine.connector.IeConnectionSpec class allows credentials to be passed during connection creation. This class supports the standard UserName and Password properties. In addition, this class supports a locale property that allows Info*Engine to generate localized data in response, and an authUser property that can be used in Single Sign On (SSO) scenarios. The authUser property is only accepted by Info*Engine if the connector is configured to digitally sign outgoing requests or if the client resides on a host that is trusted.
com.infoengine.connector.IeInteractionSpec
The com.infoengine.connector.IeInteractionSpec class drives interactions with Info*Engine. The standard FunctionName property specifies the method of function to invoke. This value corresponds to the name of the task delegate to invoke. The additional ClassName property specifies the class the task delegate belongs to. This value corresponds to a type identifier that contains the task delegate to invoke.
com.infoengine.connector.IeInteractionResult
The javax.resource.cci.Interaction implementation supports executing with input record only. It does not support executing with input and output record. The interaction implementation always returns an instance of com.infoengine.connector.IeInteractionResult (implements javax.resource.cci.Record). The IeInteractionResult class is a simple wrapper for the SOAP response. The response object can be retrieved using the getResult() method. An interaction accepts as input either MappedRecord or IndexedRecord.
In the case where MappedRecord is passed, the keys in the map are parameter names and the values are parameter values. In the case where IndexedRecord is passed, each value must be a name=value pair of parameters to be passed. Ideally, MappedRecord should be used, as the use of name=value strings does not allow for any data type other than java.lang.String to be passed.
The following is an example interaction with Info*Engine:
ConnectionFactory cxf = getLDAPFactory (); // look up in JNDI
Connection cx = null;
try {
// get connection with credentials
IeConnectionSpec cxSpec = new IeConnectionSpec ();
cxSpec.setUserName ( "wcadmin" );
cxSpec.setPassword ( "wcadmin" );
cx = cxf.getConnection ( cxSpec );
// or anonymous
//cx = cxf.getConnection ();
Interaction ix = cx.createInteraction ();
IeInteractionSpec ixSpec = new IeInteractionSpec ();
ixSpec.setClassName ( "org.myOrg.Math" );
ixSpec.setFunctionName ( "sum" );
RecordFactory rFact = cxf.getRecordFactory ();
MappedRecord iRec = rFact.createMappedRecord ( "input" );
iRec.put ( "x", new Integer ( 4 ) );
iRec.put ( "y", new Integer ( 5 ) );

IeInteractionResult result =
(IeInteractionResult)ix.execute ( ixSpec, iRec );
Integer sum = (Integer)result.getResult ();
System.out.println ( "sum is " + sum.intValue () );
} catch ( Exception ex ) {
ex.printStackTrace ();
} finally {
if ( cx != null ) cx.close ();
}