IiopGetBinary Function

Action

Retrieves a return parameter containing binary data from a CORBA object. This function can be used to get the return parameters of an operation.

Include file

IIOP.bdh

Syntax

IiopGetBinary( in  hIiop       : number,
               out sBuffer     : string,
               in  nBufferSize : number optional,
               out nDataLen    : number optional,
               in  nAlign      : number optional): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object
sBuffer Buffer receiving the binary data associated with the CORBA object
nBufferSize Size of the buffer receiving the binary data (optional). If specified, make sure to set nBufferSize <= StrSize(sBuffer).
nDataLen Variable receiving the number of bytes retrieved (optional)
nAlign

Binary data alignment (optional). Possible options are:

  • IIOP_ALIGN_2. Alignment to 2-byte boundaries

  • IIOP_ALIGN_4. Alignment to 4-byte boundaries

  • IIOP_ALIGN_8. Alignment to 8-byte boundaries

  • IIOP_ALIGN_16. Alignment to 16-byte boundaries

Default setting is alignment to 1-byte boundaries.

In addition, the byte order within the binary data can be specified:

  • IIOP_BIG_ENDIAN. Most significant byte is sent first

  • IIOP_LITTLE_ENDIAN. Least significant byte is sent first

Example

dcltrans
  transaction TGetBinary
  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 : string(512);
  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 "GetBuffer"
    IiopRequest(hIiop, "GetBuffer");

    // retrieve return parameter
    IiopGetBinary(hIiop, sBuffer, STRING_COMPLETE,
    0, IIOP_ALIGN_16 | IIOP_BIG_ENDIAN);
    IiopObjectRelease(hIiop);
  end TGetBinary;

Sample scripts

Conf.bdf

You can find the sample script(s) here: <Public documents>\Silk Performer <version>\Samples\Corba