Runtime components : Service components : JCA SNA Connector : JCA SNA LU0 Connector : Tasks : JCA LU0 Sample Code : Using CCI for Outbound Communication
  
Using CCI for Outbound Communication
// get the connectionFactory by JNDI lookup:
initialContext = new javax.naming.InitialContext();
connectionFactory = (ConnectionFactory) initialContext.lookup("snalu0");
//If you are using JCA security, pass the user name and password.
Lu0ConnectionSpec lu0ConnectionSpec = new Lu0ConnectionSpec();
lu0ConnectionSpec.setUserName("sna");
lu0ConnectionSpec.setPassword("sna");
Connection cxn = connectionFactory.getConnection(lu0ConnectionSpec);
//If you are not using JCA security, you can just get the connection: // // // Connection cxn = connectionFactory.getConnection();
//Set up the conversation:
Interaction ixn = cxn.createInteraction();
Lu0InteractionSpec ixnSpec = new Lu0InteractionSpec();
Lu0Record outgoingData = new Lu0Record();
Lu0Record returnData = new Lu0Record();
//Create the outgoing request message and send it:
ixnSpec.setInteractionVerb(ixnSpec.SYNC_SEND);
outgoingData.setData(requestData);
ixn.execute(ixnSpec, outgoingData, null);
//Set up to receive the response message:
ixnSpec.setInteractionVerb(ixnSpec.SYNC_RECEIVE);
ixnSpec.setExecutionTimeout(500);
ixn.execute(ixnSpec, null, returnData);
ixn.close();
cxn.close();
Go up to
JCA LU0 Sample Code