IiopGetDataByTypeCode Function

Action

Retrieves a certain amount of data from a CORBA object. The data is described by a type code. This function is used, for example, to retrieve recursive data structures.

Include file

IIOP.bdh

Syntax

IiopGetDataByTypecode( in  hIiop       : number,
                       in  sTypeCode   : string,
                       in  nCodeLength : number optional,
                       out sBuffer     : string optional,
                       in  nSize       : number optional,
                       out nReceived   : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object.
sTypeCode Type code that specifies which data is to be retrieved from the CORBA object.
nCodeLength Length of the type code that specifies which data is to be retrieved from the CORBA object (optional).
sBuffer Buffer that will receive the data from the CORBA object (optional).
nSize Size of the buffer that will receive the data from the CORBA object (optional).
nReceived Variable that will receive the number of bytes that were actually retrieved from the CORBA object (optional).

Example

dcltrans  transaction
 TGetChar
  const
    HOST   := "192.168.20.21"; // server
    PORT   := 1052;            // port
    KEY    := "...\h00";       // key
    KEYLEN := 4;               // key length
  var
    hIiop              : number; // Handle to CORBA object
    sBuffer, sTypecode : string;    nTypecode, nLength : 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 "GetLong"
    IiopRequest(hIiop, "GetLong");
    SetLong(sTypecode, 1, IIOP_TK_LONG);
    IiopGetDataByTypecode(hIiop, sTypecode, STRING_COMPLETE, sBuffer);

    Print("GetLong returned: " + string(GetLong(sBuffer, 1)));
    IiopObjectRelease(hIiop);
  end TGetChar;