In BeanConnect you specify the EIS partner to be addressed when deploying a managed connection factory. You use the lookup()
method to search for the connection factory and obtain a connectivity object by calling the getConnection()
method.
The connectivity object provided implements the EISConnection
interface for communication with the EIS application:
Set up the initial context:
javax.naming.InitialContext ic = new InitialContext();
Reference a connection factory:
net.fsc.jca.communication.EISConnectionFactory cf = (EISConnectionFactory)ic.lookup ("java:comp/env/<resource_reference_name>");
Set up the connection:
net.fsc.jca.communication.EISConnection con = (EISConnection) cf.getConnection();
If you use the
EISConnection
interface in order to specify the service name (TAC) or the name of the EIS service, proceed as follows:con.setServiceName(<name_of_the_service>);
However, you should note that for performance reasons, it is recommended that you work with the preconfigured service names.
Create the message that you want to send
String requestMessage = "...";
Call the EIS application and receive the reply message:
String replyMessage = con.call(requestMessage);
Close the connection:
con.close();
Further information on how to program the EISConnection
and EISOltpConnection
interfaces is provided in the JavaDoc of the interface itself.
You will find a sample in Example 13 on Querying information on the conversation with the EIS application .