IiopGetEncapsulation Function

Action

Reveals the content of an encapsulation as defined in the CORBA specification. Encapsulations are, for example, used within service contexts and the function is a handy way to work inside an encapsulation.

Include file

IIOP.bdh

Syntax

IiopGetEncapsulation( in    hParserIn  : number,
                      inout hParserOut : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hParserIn A handle to a parser, which may also be a CORBA object, from which the encapsulation is read.
hParserOut A handle that can subsequently be used to inspect the contents of the encapsulation by using the IiopGet functions.

Example

dcltrans
  transaction TServiceContext
  const
    HOST   := "192.168.20.21"; // server
    PORT   := 1052; // port
    KEY    := "...\h00"; // key
    KEYLEN := 4; // key length
  var
    hIiop   : number; // handle to CORBA object
    hSrvCtx : number; // handle to service context
    hEnc    : number; // handle to a parser object containing an
    // encapsulation (IIOP data block);
    i          : number;
    nServCtxId : number;
  begin
    IiopSetMaxGiopVersion("1.2");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);

     // retrieve handle to server
    IiopObjectCreate(hIiop, "IDL:DemoObject:1.0", "1.2",
                     HOST, PORT, KEY, KEYLEN); 

    // create service context
    IiopBeginServiceContext(hIiop, 1, IIOP_LITTLE_ENDIAN);
    IiopSetUlong(hIiop, 0x1010);
    IiopSetUlong(hIiop, 0x0110);
    IiopEndServiceContext(hIiop);

    // pass long value parameter to request
    IiopSetLong(hIiop, 593814064);
    // call request "DecToHex" with long parameter
    IiopRequest(hIiop, "DecToHex");
    IiopGetServiceContextList(hIiop, hSrvCtx);

    for i := 1 to IiopGetLong(hSrvCtx);
      IiopGetLong(hSrvCtx, nServCtxId);
      IiopGetEncapsulation(hSrvCtx, hEnc);
      if nServCtxId = 0 then
        IiopGetLong(hEnc);
        ...
      end;
    end;

    ...
    IiopParserRelease(hSrvCtx);
    IiopParserRelease(hEnc);
    IiopObjectRelease(hIiop);
  end TServiceContext;