Server Programming in JCo Part 3

This is a continuation of Server Programming in JCo Part 2. In this post, I will deal with receiving and parsing the actual call from SAP.

In the previous post, the setup of the JCO.Server class was explained. To actually do anything with this class, we have to override the handleRequest() method. This method gets called when ever the SAP system with the proper credentials contacts your server.

In the handleRequest() function, There are 2 important tasks that are almost always included:

  1. Get the parameters for input, output, and table structures using the JCO.Function class
  2. Checking the function name to make sure the right code is run

[Read more...]

Server Programming in JCo Part 2

This is a continuation of Server Programming in JCo Part 1. In this post, I will deal with the setting up the constructs of the java program acting as the server.

The key Java object in JCO server programing is the JCO.Server, which is easy to use, but very powerful. At a high level, only these three things are needed to setup the server class:

  1. extend the JCO.Server class
  2. in your constructor, call one of the JCO.Server constructors
  3. override the handleRequest(JCO.Function function) method

Below is an example of a basic server setup. When the Server is running, all requests coming from the configured SAP system, will be sent to the handleRequest() function

[Read more...]