IiopRequest Function

Action

Sends an IIOP Request Message. Depending on the specified message type, it is possible to wait until this function receives an IIOP Reply Message from the server.

Include file

IIOP.bdh

Syntax

IiopRequest( in hIiop    : number,
             in sRequest : string,
             in nFlag    : number optional,
             in nId      : number optional): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object
sRequest Name of the requested operation
nFlag

Specifies the request message variant sent to the server (optional). Possible values are:

  • IIOP_RESPONSE_EXPECTED. Waits for a response (default)

  • IIOP_SYSTEM_RESPONSE. A response from the server is expected, but the response does not necessarily contain application level data (ORB dependent).

  • IIOP_ONEWAY. No response from the server expected

  • IIOP_NON_BLOCKING. Indicates that the caller will not wait for an immediate reply. This flag can be used to generate asynchronous IIOP traffic

This parameter may be combined with the following flag:

  • IIOP_IGNORE_EXCEPTION. Prevents the generation of error messages.

This parameter may be combined with the following flag:

  • IIOP_IGNORE_FORWARDS. The request is not re-sent if a "location forward" or "needs addressing mode" response is received.

This parameter may be combined with one of the following flags:

  • IIOP_ADDR_KEY. The target address is specified by the key. This is the default addressing mode.

  • IIOP_ADDR_PROFILE. The target address is specified by a profile (part of an IOR). This addressing mode is needed, for example, for traversing firewalls.

  • IIOP_ADDR_REFERENCE. The target address is specified by an IOR.

This parameter may be combined with one of the following flags:

  • IIOP_USE_V10. The request is sent using IIOP 1.0 encoding (if possible).

  • IIOP_USE_V11. The request is sent using IIOP 1.1 encoding (if possible).

  • IIOP_USE_V12. The request is sent using IIOP 1.2 encoding (if possible).

nId

Identification number for this request (optional).

注: This parameter affects the function's behavior only if nFlag is set to IIOP_NON_BLOCKING.

If an identification number is associated with a request, the IiopWaitForReply function can be used to wait for a reply from the request. Exceptional cases:

  • 0. Return parameters will not be stored, consequently no reply data can be retrieved (default)

  • -1 is not allowed

Example

dcltrans
  transaction TRequest
  const
    HOST := "192.168.20.21"; // server
    PORT := 1052; // port
    KEY := "...\h00"; // key
    KEYLEN := 4; // key length
  var
    hIiop : number; // handle to a CORBA object
    nSum : number;
  begin
    IiopSetMaxGiopVersion("1.0");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);
    // retrieve handle to server
    IiopObjectCreate(hIiop, "IDL:DemoObject:1.0", "1.2", 
                        HOST, PORT, KEY,KEYLEN);
    // call request "Print"
    IiopRequest(hIiop, "Print", IIOP_ONEWAY | IIOP_ADDR_PROFILE);
    IiopObjectRelease(hIiop);
  end TRequest;