IiopBeginServiceContext Function


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



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.

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).


  transaction TServiceContext
    HOST   := ""; // server
    PORT   := 1052; // port
    KEY    := "...\h00"; // key
    KEYLEN := 4; // key length
    hIiop: number; // handle to CORBA object

     // 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);

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