APIs for Providing an RPC Context from the Natural Client Side

This document gives an overview on application programming interfaces (APIs) to provide the context for an RPC call, for example passwords or a default server. The following topics are covered:

For further information on APIs, refer to Application Programming Interfaces for Use with Natural RPC in the section Prerequisites and Preparatory Information.


RPC-CNTX

The API RPC-CNTX can be used for providing a context for RPC calls as it is done in test programs generated by the webMethods EntireX Natural Wrapper.

RPC-CNTX combines the functionality of several APIs and is available in library SYSTEM. There is no need for extra preparations such as setting a STEPLIB or to copy APIs from SYSEXT to user libraries.

Start of instruction setTo make use of RPC-CNTX

  1. Specify a DEFINE DATA statement

    where level 01 is defined by 01 RPC-CNTX-AREA, and specify the following parameters on level 02:

    Parameter Format I/O Description
    FUNCTION A02 I
    'SL' Set the RPC context depending on the parameters given and log on to EntireX Broker.
    'SC' Set the RPC context depending on the parameters given.
    'GC' Get RPC context. By default, the required information relates to the default server.
    'LO' Log on to EntireX Broker
    'LF' Log off from EntireX Broker
    BROKERID A dynamic I/O Specify the broker name.

    See the keyword subparameter SRVNODE of the RPC profile parameter.

    CLASS A32 I Specify the server class. For Natural RPC servers, this is RPC. See the keyword subparameter SRVNAME of the RPC profile parameter.
    SERVER A32 I/O Specify the server name. See the keyword subparameter SRVNAME of the RPC profile parameter.
    SERVICE A32 I Specify the type of RPC. For Natural RPC servers, this is CALLNAT.
    COMPRESSLEVEL A01 I/O Compression level requires API version 7.
    RESERVED I01 I/O Reserved for future use.
    RPC-LIBRARY A08 I  
    RPC-RELIABLE-STATE N01 I/O
    0 No reliable RPC (standard RPC execution)
    1 Reliable RPC (AUTO_COMMIT)
    2 Reliable RPC (Client_COMMIT)
    NAT-LOGON A011 I/O  
    EXX-USERID A32 I  
    EXX-PASSWORD A32 I  
    RPC-USERID A32 I  
    RPC-PASSWORD A32 I  
    ERR-CODE I04 O The origin of some error code can be detected by the following identifiers:
    USR1071N,(USR4371N) 1nnnn
    USR6304N 2nnnn
    USR2007N 3nnnn
    USR4008N 5nnnn
    USR4009N 8nnnn
    USR2071N 9nnnn
    ERR-TEXT A dynamic O  
    RPC-ETID A08 I Allow impersonation without password verification (optional).

    Note:
    The most important function codes are 'SL' and 'LF'. Function code 'SL' is a combination of setting the RPC context ('SC') and a logon to EntireX Broker ('LO').

  2. In the calling program on the client side, specify the following statement:

    CALLNAT 'RPC-CNTX' RPC-CNTX-AREA

    For further information refer to Syntax Description in CALLNAT in the Statements documentation.

The setting of the RPC context is processed as follows:

  1. Set the credentials for RPC server by specifying RPC-USERID and RPC-PASSWORD (API USR1071N).

  2. Set the mode for reliable RPC by specifying RPC-RELIABLE-STATE (API USR6304N).

  3. Set the data for the RPC default server including the logon option with a specification for BROKERID, SERVER and NAT-LOGON (API USR2007N).

  4. Change the library name on the RPC server for the logon by specifying RPC-LIBRARY (API USR4008N). If the name is left blank, the API is not called.

  5. Set parameters for EntireX COMPRESSLEVEL by using API USR4009N. If no values are specified, the API is not called.

  6. Optionally, set an ETID by specifying RPC-ETID (API USR4371N) if impersonation without password check is active for the Natural RPC server.

  7. For logging on to the EntireX Broker, specify BROKERID, EXX-USERID, and EXX-PASSWORD, which are then passed to USR2071N.

After you have finished your work with the RPC connection, you need to log off from the EntireX Broker using RPC-CNTX with function code 'LF'.