IiopGetValue Function

Action

Retrieves a value type return parameter from a CORBA object. This function can be used to get the return parameters of an operation. This function is the same as the IiopGetDataByTypecode function;

Include file

Iiop.bdh

Syntax

IiopGetValue( in  hIiop     : number,
              in  sTypecode : string,
              in  nTcLen    : number optional,
              out sBuf      : string optional,
              in  nBufLen   : number optional,
              out nUsed     : number optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hIiop Handle to a CORBA object.
sTypecode Typecode needed for parsing the value type from the IIOP reply messages.
nTcLen Length of sTypecode (optional).
sBuf Buffer where the value is copied to (optional).
nBufLen Length of the buffer where the value is copied to (optional).
nUsed Number of bytes that are copied to sBuf (optional).

Example

dcltrans
  transaction TGetValue
  const
    HOST   := "192.168.20.21"; // server
    PORT   := 1052;            // port
    KEY    := "...\h00";       // key
    KEYLEN := 4;               // key length
    csTypecode := "\h0000001D000000C20000000000000038524D49"
      "\h3A6A6176612E6C616E672E496E74656765723A363444343743"
      "\h314430313938304235453A3132453241304134463738313837"
      "\h33380000000008496E746567657200000000000000001D0000"
      "\h00580000000000000036524D493A6A6176612E6C616E672E4E"
      "\h756D6265723A3731444138424537463937313132383A383641"
      "\h43393531443042393445303842000000000000074E756D6265"
      "\h72000000020000000000000000000000000001000000010000"
      "\h0000000000030000";
  var
    hIiop  : number; // Handle to CORBA object
    sValue : string(4096);
  begin
    IiopSetMaxGiopVersion("1.2");
    IiopSetByteOrder(IIOP_BIG_ENDIAN);

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

    // call request "NextValue"
    IiopRequest(hIiop, "NextValue");

     // retrieve value type return parameter
    IiopGetValue(hIiop, csTypecode, STRING_COMPLETE, sValue); 
    write("retrieved value type:"); writeln;    WriteData(sValue, STRING_COMPLETE, OPT_WRITEDATA_HEX);
     IiopObjectRelease(hIiop);
  end TGetValue;

Output

retrieved value type: 00000000 ·······8RMI:java 7F FF FF 02 00 00 00 38 52 4D
49 3A 6A 61 76 61 00000010 .lang.Integer:64 2E 6C 61 6E 67 2E 49 6E 74 65
67 65 72 3A 36 34 00000020 D47C1D01980B5E:1 44 34 37 43 31 44 30 31 39 38
30 42 35 45 3A 31 00000030 2E2A0A4F7818738· 32 45 32 41 30 41 34 46 37 38
31 38 37 33 38 00 00000040 ···· 00 00 00 01