SapConnectionService
The SAPConnectionService provides connections to SAP systems via a similar mechanism as the DatabaseService. That is, connections are represented by aliases and kept alive if left idle for a period of time.
The operation requires SAP's own JCo driver, which works via JNI and therefore only runs on a limited number of platforms. Currently these are the following.
MS Windows systems from version 2000.
Linux.
Solaris.
In addition to pure connection management, which defines the Integration Server as client to an SAP system, it is also possible to implement ALE scenarios. For this purpose, it is possible to define so-called RequestListener, which respond to incoming requests from the connected SAP system and, for example, forward IDocs to subsequent processes for further processing.
XML configuration
Important note: The availability of a service depends on the license purchased and whether the service has been registered in the configuration file ./etc/factory.xml of the Service Factory (changes require server restart!). There you will also find the responsible configuration file for a service, otherwise you can also edit the configuration file of the service directly in the GUI of the service (changes require a service restart!).
The following XML fragment with all possible basic settings can be used for the configuration of the SAPConnectionService.
<
Set
name
=
"idleTime"
>20000</
Set
>
<
Set
name
=
"rebuildConnectionOnRecycle"
type
=
"boolean"
>true</
Set
>
<
Set
name
=
"transactionJdoAlias"
>hub</
Set
>
<
Set
name
=
"transactionJdoServiceName"
>JDOService</
Set
>
The parameters have the following meaning.
idleTime |
The time, in milliseconds, to wait between two validity checks of the connections in the pool. |
rebuildConnectionOnRecycle |
If this value is set to true, the service will attempt to reestablish connections immediately if they are discarded as no longer valid and if the pool size is less than the initial size. This procedure makes sense in connection with the use of a RequestListener to ensure that there is always a connection to the SAP system via which data can be transferred from the SAP system to the Integration Server. |
transactionJdoAlias |
Database alias for storing and tracking transaction IDs. This functionality is not active yet. However, it is already possible to make the appropriate settings. |
transactionJdoServiceName |
The name of the JDOService for storing and tracking transaction IDs. This functionality is not active yet. However, it is already possible to make the appropriate settings. |
Adding an SAP connection
The following XML fragment adds a new SAP connection to the pool of the SAPConnectionService.
<
call
name
=
"initPool"
>
<
Arg
>
<
New
class
=
"com.ebd.hub.services.sap.SapSettings"
>
<
Set
name
=
"alias"
>sap</
Set
>
<
Set
name
=
"client"
>100</
Set
>
<
Set
name
=
"host"
>127.0.0.1</
Set
>
<
Set
name
=
"language"
>DE</
Set
>
<
Set
name
=
"user"
>BCUSER</
Set
>
<
Set
name
=
"password"
>MINISAP</
Set
>
<
Set
name
=
"system"
>00</
Set
>
<
Set
name
=
"minSize"
>2</
Set
>
<
Set
name
=
"maxSize"
>10</
Set
>
<
Set
name
=
"allowGrowing"
>False</
Set
>
<
Set
name
=
"idleTime"
>300000</
Set
>
<
Set
name
=
"checkConnection"
>300000</
Set
>
<
Set
name
=
"numberRetries"
>5</
Set
>
<
Set
name
=
"retryWaitTime"
>10000</
Set
>
[Possible settings for RequestServer]
</
New
>
</
Arg
>
[Possible settings for RequestListener]
</
call
>
The parameters have the following meaning.
client |
The client ID with which the SAP system is to be contacted (e.g. 100). |
host |
The host name of the SAP system to be contacted, or the connect string if the connection is to be made via a gateway. |
language |
The language to be used. |
user |
The user name with which the SAPConnectionService should authenticate to the SAP system. |
password |
The password with which the SAPConnectionService should authenticate to the SAP system. |
system |
The system ID with which the SAP system is to be contacted (e.g. 00). |
minSize |
The initial size of the pool to be built when the SAPConnectionService starts. |
maxSize |
The maximum size of the pool. If this setting is omitted or -1 is specified, the system default is used. |
allowGrowing |
If this option is activated, the SAPConnectionService may establish new connections to the SAP system if there are no available connections at the time of demand. |
idleTime |
Time in milliseconds that a connection must be unused before its validity is checked by the SAPConnectionService. |
checkConnection |
If this option is selected, the validity of each connection is checked before it is issued. |
numberRetries |
Number of allowed attempts to establish a connection before aborting with an error message. Attention: If the error is due to incorrect user data, this can quickly lead to the blocking of the user. |
retryWaitTime |
Waiting time between two connection attempts. |
Attention: For older SAP systems, when entering the password, make sure that this is done in capital letters. Otherwise, the SAP system rejects the attempt and sooner or later locks the user.
Adding a "RequestListener"
The following XML fragment adds a RequestListener to an SAP connection that responds to incoming requests from the connected SAP system.
<
Call
name
=
"addRequestListener"
>
<
Arg
>alias</
Arg
>
<
Arg
>
<
New
class
=
"classname"
>
</
New
>
</
Arg
>
</
Call
>
Where "alias" is the SAP alias of the connection and "classname" is the name of the class that should act as a RequestListener.
General settings
(1) The time, in milliseconds, to wait between two validity checks on the connections in the pool.
(2) If this checkbox is set, the validity of a connection will be checked before it is issued.
Available SAP connections
(1) List of all available SAP connections. It shows the alias, whether the connection is suspended (4), the number of connections in the pool (unused), and the total number of active connections.
(2) Connections can be viewed (see next section), removed and added via the context menu.
(3) The connection information (attributes and properties of the client connections and the request server).
(4) Here the SAP alias can be suspended and the suspension can be removed again. The status is shown in (1). A suspension means that all connections to this SAP system are terminated. Profiles that attempt to access a suspended SAP alias will end with an error and may need to be restarted later.
(5) You can query RFC metadata from a connected SAP system. The result is an HTML page containing all input and output parameters. See also section SAP RFC.
SAP alias settings
(1) Name of the alias. The name must be unique.
(2) The initial pool size.
(3) The maximum pool size.
(4) Time in milliseconds that a connection must be unused before its validity is checked by the SAPConnectionService.
(5) Number of attempts to connect before aborting with an error message and time in milliseconds to wait between two connection attempts.
(6) Trace level for the JCO driver debug output (0 = no output) and specification of the directory into which these trace messages are to be written. If a trace level > 0 is selected, a directory must be specified.
(7) The connection parameters for the client connection.
(8) The parameters for the request server.