Walk-Through: Requestors

Synapta Services Builder provides an easy to use API enabling session connection, HLLAPI like processing, and symbolic BMS map field name processing of CICS 3270 screen applications and session cleanup. In the latter case, some of the high level functionality for this symbolic exchange of 3270 information is based on the BMS map sets defined in the CICS 3270 application itself. For example, to update the account number on a screen where the account number field is named "ACCOUNT" in the BMS map, the caller can exchange the information symbolically. For example, placing the value "2002" in the "ACCOUNT" field could be done by issuing a SetFieldValue("ACCOUNT", "2002"). This capability frees the requestor from row/column dependency in the 3270 application, allowing a reference to information by name (or index).

There is also an API function that works with a collection of fields by name and index instead of row/column positions. The GetAllFieldInformation function retrieves all of the field information from the current host screen. The field level information can then be processed at the requesting application without the need for multiple trips to the host.

The Synapta Services Builder Requestors support both Java and Windows environments. Each platform server is a thin runtime layer that takes the Bridge API Request function and its parameters, and packages them into a request format expected on the host. On the return trip, the platform server parses the host response and returns the function's response parameters to the client application.

Using the COM+ requestor to create an ASP.

In Microsoft Visual Studio or your favorite text editor:

'Instantiate the supplied COM Object from the CICS Bridge COM Requestor Install
'using server.CreateObject for the registered component.
'******************************************************************************
'*Remember to include appropriate error handling, not shown below.
'******************************************************************************

Dim myObject
Dim outText

set myObject = server.CreateObject("BridgeAPI.BridgeAPIObject.1")

'*******************************************************************************************************
'*Upon success, use the instantiated object variable for invoking the desired methods from  
'*the API documented in the QACOM Reference Guide for the COM Environment, included 
'*with this product.
'*******************************************************************************************************
'For example, to access the optionally installed ATM1 transaction supplied with the SMP/E host
'installation for this product you may code something like the following sequence:

'Connect to a host session using a valid set of credentials
  myObject.ConnectBridge "111.2222.333.444", 2327, 2, "USERID", "PASSWD"

'Move to the screen that contains the desired 3270 information
  myObject.SendKeys "ATM1@E"
  myObject.GetString -1, 9, 41, 4, outText
'Manipulate and present harvested outText data as desired.

'Remember to exit out of your CICS application gracefully before disconnecting
'ATM1 requires a CLEAR key for a graceful end.
  myObject.SendKeys "@C"
  myObject.Disconnect

Using the .NET requestor to create a Web aspx application in Developer Studio .NET

  1. Bring up Microsoft Visual Studio .NET.

  2. From the File menu, select New, then Project.

  3. Select Visual Basic Project on the left side then select ASP .NET Web Application.

  4. Specify a name for your service.

  5. Click OK.

  6. Create the User Interface controls that you would like to see in your application.

  7. From the Project menu, select Add Web Reference.

  8. Enter the URL to Synapta Services Builder for CICS Web Service (for example, http://localhost/websvcbridgeapi/WebSvcBridgeAPI.asmx?wsdl ).

  9. Choose Add Reference.

Visual Basic .Net Web Application Code

'Declare your reference to the newly imported web service eg:
Dim WSB As New ATM1HELLO.WebSvcBridgeAPI.WSBridgeAPI

'Declare a CookieContainer to hold requisite session information eg.
WSB.CookieContainer = New System.Net.CookieContainer()

'Then issue the desired commands to harvest the screen information eg: 

'Connect to a host session using a valid set of credentials
  rc = WSB.ConnectBridge("n.n.n.n", 2327, 2, "USERID", "PASSWD")

'Move to the screen that contains the desired 3270 information
  rc = WSB.SendKeys("ATM1@E")
  rc = WSB.GetString(-1, 9, 41, 4, outText)
  TerminalID.Text = outText

'Remember to exit out of your CICS application gracefully before disconnecting
  rc = WSB.SendKeys("@C")
  rc = WSB.Disconnect()
 

Using the Java Application Requestor

/* In your favorite editor create the java program as follows: */

/* import the Synapta Services Builder CICS 3270 Bridge API from BridgeAPI.jar eg: */
import com.attachmate.cicsbridge.ws.*;

/* declare your Java Class eg: */
public class BridgeSimple1 { public static void main(String[] args) {

  /* declare your local variables */
  String hostIP = "1.2.3.4";         /* set this to the IP address of the CICS region */
  int hostPort = 2317;       /* set this to the TCPIPSERVICE Port defined in the target CICS */
  int terminalModel = BridgeAPI.MODEL_2; 

  String userid = "UNAME";          /* Set up your RACF USERID here */
  String password = "12345";        /* and corresponding RACF PASSWORD here */

  MutableInt scrRows = new MutableInt();
  MutableInt scrCols = new MutableInt();
  MutableObject scrText = new MutableObject();
  int     rc  = 0;                   // result code of each method call

  try {
           BridgeAPI bridge = new BridgeAPI();  /* create an instance of the bridgeAPI object */

           /* Issue the desired commands to harvest the 3270 screen information eg: */

           /* Connect to the target CICS host region */
           bridge.connectBridge(hostIP, hostPort, terminalModel, userid, password);
	
           /* Move to the screen that contains the desired 3270 information */
           bridge.sendKeys("ATM1@E");
	
           /* Collect the desired 3270 information */
           rc = bridgeAPI.getString( -1,           /* the value of (-1) indicated current screen */ 
                                      9,           /* int inStartRow */
                                     41,           /* int inStartColumn */
                                      4,           /* int number positions */
                                     scrText  );   /* where the screen text should go */
           String myterminalID = (String) scrText.getObject();
	
           System.out.println("You are on Terminal: ");
           System.out.println(myterminalID);

           /* Remember to exit out of your CICS application gracefully before disconnecting */
           rc = bridge.SendKeys("@C");
           rc = bridge.Disconnect()
      }
  catch (Exception e) {
                           // TODO Auto-generated catch block
                           e.printStackTrace();
                           System.exit(16);
                       }

            }
}


/* Save your program and compile with: javac -classpath .;BridgeAPI.jar BridgeSimple1.java */
/* Run with : javac -classpath .;BridgeAPI.jar BridgeSimple1.class */
Walk-Through TopicsspacerPrevious TopicNext Topic
Bullet Walk-Through Overview
Bullet Data Engine Components
Bullet Requestors
Bullet ID Management spacer
  Attachmate