IiopBeginServiceContext Function

Action

Prepares a CORBA object handle for construction of a service context. The content of the service context is supplied using an IIOPGetFunctions function and is completed by calling an IiopEndServiceContext function.

Service context lists are held globally for CORBA objects. This means that service context lists are sent unchanged with each IiopRequest function call, unless a new service context list is created using the functions IiopBeginServiceContext, IiopEndServiceContext, IiopSetServiceContext, or IiopDeleteServiceContextList.

However, when a service context list is defined for a callback object using the same functions, the list is bound to a special operation defined by IiopObjectListen. When this operation is invoked by the server, Silk Performer returns the service context list along with the IIOP reply message.

Include file

IIOP.bdh

Syntax

IiopBeginServiceContext( in hIiop      : number,
                         in nServiceId : number,
                         in nByteOrder : number optional
                         in bIgnoreBO  : boolean optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle of a CORBA object.
nServiceId Unsigned long value that represents the service ID number.
nByteOrder

A service context can be marshaled in a byte order that is different than the rest of an IIOP message. When omitted, the current byte order is assumed.

Valid parameters include either of the following:

  • IIOP_BIG_ENDIAN. The most significant byte is sent first

  • IIOP_LITTLE_ENDIAN. The least significant byte is sent first

bIgnoreBO When true, the byte order flag is not sent. This flag is only used with VisiBroker security tickets (optional, default value = false).

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
  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");
    ...
    IiopObjectRelease(hIiop);
  end TServiceContext;