Retrieves information about a value type return parameter from a CORBA object based on the return value, either true or false. This function can be used to get the return parameters of an operation. If the return value is true, then only the header part is returned. If the return value is false, then the whole value is returned.
Iiop.bdh
IiopGetValueHeader( in hIiop : number, in sTypecode : string, in nTcLen : number optional, out sBuf : string optional, in nBufLen : number optional, out nUsed : number optional): boolean;
true if the current value is a non-derived value (the repository IDs of the value and the typecode match) that does not contain other values.
false otherwise; the value may be a derived type or may contain other values, indirections, or null-values.
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 header is copied to in case the return value is true (optional). If the return value is false the whole value is copied to this buffer. |
sBufLen | Length of the buffer where the value is copied to (optional). |
nUsed | Number of bytes that are copied to sBuf (optional). |
dcltrans transaction TGetValueHeader 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 sValueHeader : 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 if IiopGetValueHeader(hIiop, csTypecode, STRING_COMPLETE, sValueHeader) then writeln("retrieved value header:"); WriteData(sValueHeader, STRING_COMPLETE, OPT_WRITEDATA_HEX); writeln("retrieved value: "); write(IiopGetLong(hIiop)); else writeln("retrieved value type:"); WriteData(sValue, STRING_COMPLETE, OPT_WRITEDATA_HEX); end; IiopObjectRelease(hIiop); end TGetValueHeader;
retrieved value header:00000000 ·······8RMI:java 7F FF FF 02 00 00 00 38 52 4D 49 3A 6A 61 76 6100000010 .lang.Integer:64 2E 6C 61 6E 67 2E 49 6E 74 65 67 65 72 3A 36 3400000020 D47C1D01980B5E:1 44 34 37 43 31 44 30 31 39 38 30 42 35 45 3A 3100000030 2E2A0A4F7818738· 32 45 32 41 30 41 34 46 37 38 31 38 37 33 38 00retrieved value: 1
or:
retrieved complete value:00000000 ·······8RMI:java 7F FF FF 02 00 00 00 38 52 4D 49 3A 6A 61 76 6100000010 .lang.Integer:64 2E 6C 61 6E 67 2E 49 6E 74 65 67 65 72 3A 36 3400000020 D47C1D01980B5E:1 44 34 37 43 31 44 30 31 39 38 30 42 35 45 3A 3100000030 2E2A0A4F7818738· 32 45 32 41 30 41 34 46 37 38 31 38 37 33 38 0000000040 ···· 00 00 00 01