RAPP - Remote Application API

The RAPP API (Remote Application Protocol Application Programming Interface) is an API that can be used by other applications to interact with NetPhantom applications running on a NetPhantom Server.

Before the introduction of the RAPP API in the NetPhantom Server, it was impossible for other applications to use the NetPhantom Server to access host-based systems. This meant that all applications had to have their own module for accessing the host, even if they wanted to access the same host application. To write modules for host access was often a complicated and time-consuming process.

With the introduction of the NetPhantom RAPP API, it is now possible to use the NetPhantom Server as an integration hub. All the other server-side applications that want to access the host-based systems can now talk to the NetPhantom Sever and use the NetPhantom Server for host access. This also means that when you add RAPP support to an application, you automatically get access to host systems on both AS/400 and Mainframe computers. Writing a module that can use RAPP is also a much easier, hence cheaper, process than writing a module that directly accesses the host.

Host access applications running on the NetPhantom Server can be developed and tested using the NetPhantom Java Client without implicating the Client Applications. The process is visual, allowing the developer(s) and tester(s) to check host data in the NetPhantom graphical panels.

This work method results in robust and well-tested host access applications running under the NetPhantom Server, that are ready to be integrated with other requesting applications. Construction and testing of complex, multi-tier applications is greatly simplified.

How to Use RAPP

Explaining how to use RAPP is the purpose of this entire document and its accompanying sample (SAMPLES_RAPPAPI). But in brief, you import a RAPP package that includes classes with methods that are used to manipulate the NetPhantom Application. This package, the RAPP API, makes it possible to navigate through the NetPhantom Application, to get/set data in the NetPhantom Application, and to directly access the host screens.

This means that the whole host application, and all its data, is available to every application that interfaces with the RAPP API. We call the application that uses the RAPP API to communicate with the NetPhantom Server a Client Application, even though it might be a server to other clients. From NetPhantom's point of view, it is a client.

Fig. 1 How RAPP fits in the overall picture.
 

RAPP - The API

Before getting into the details of using RAPP, we must take a short look at the workflow.

There are actually two different workflow cases. The first is when the Client Application that invokes the RAPP session is able to maintain the connection throughout the whole session. This can be called a Continuous RAPP Session. The second is when the Client Application for some reason is unable to maintain the connection. This can be called an Interrupted RAPP Session.

A Continuous RAPP Session

The workflow for a Continuous RAPP Session consists of the following steps. The steps are described from the point of view of the Client Application.

  1. Create a RemoteApplication.
  2. Specify the hostname and port to connect to the NetPhantom Server.
  3. Connect to the NetPhantom Server.
  4. Create a RAPPTransaction.
  5. Create a RAPPCallHost, RAPPCallPanel, RAPPCallObject or RAPPCallClass.
  6. Do a request, with a request_XXX method in one of the above RAPPCallXXX classes.
  7. Add the action to the RAPPTransaction.
  8. Repeat steps 5-7 until all requests have been added to the RAPPTransaction.
  9. Create a RemoteTransaction from the RAPPTransaction.
  10. Do a requestTransaction from the RemoteApplication. A requestID is returned.
  11. Get a reply from the RemoteApplication with the use of the requestID. The reply is returned as a new RemoteTransaction.
  12. Call the RemoteTransaction's updateTransaction method to update all RAPPCallXXX objects.
  13. Disconnect from NetPhantom server.

The figure below presents an example of the workflow as a sequence diagram. In this example, the content of a listbox is requested. Steps 2, 3 and 13 are left out of the diagram.

Fig. 2 A sequence diagram showing the workflow for a Client Application running in Continuous mode, requesting data from a listbox in a NetPhantom application.
 

An Interrupted RAPP Session

The workflow for an Interrupted RAPP Session consists of the following steps. The steps are described from the point of view of the Client Application. After step 14 the connection to the NetPhantom Server has been terminated.

  1. Create a RemoteApplication.
  2. Specify the hostname and port to connect to the NetPhantom Server.
  3. Connect to the NetPhantom Server.
  4. Create a RAPPTransaction.
  5. Create a RAPPCallHost, RAPPCallPanel, RAPPCallObject or RAPPCallClass.
  6. Do a request, with a request_XXX method in one of the above RAPPCallXXX classes.
  7. Add the action to the RAPPTransaction.
  8. Repeat steps 5-7 until all requests have been added to the RAPPTransaction.
  9. Create a RemoteTransaction from the RAPPTransaction. A requestID is returned.
  10. Do a requestTransaction from the RemoteApplication. A requestID is returned.
  11. Get a reply from the RemoteApplication with the use of the requestID. The reply is returned as a new RemoteTransaction.
  12. Call the RemoteTransaction's updateTransaction method to update all RAPPCallXXX objects.
  13. Get the sessionID (and host address and port number if backup servers are used).
  14. Send the sessionID to the web-client
  15. Close the connection to the server.
  16. Send the sessionID from the web-client to the Java application.
  17. Create a new RemoteApplication with the saved sessionID, host address and port number.
  18. Connect to the NetPhantom Server.
  19. Create a RAPPTransaction.
  20. Continue with next request and reply.
  21. And so on...

Fig. 3 A sequence diagram showing the workflow for a Client Application running in Interrupted mode, requesting data from a listbox in a NetPhantom application before disconnecting, and then reconnecting for the next request.