Larry,
RPG passes parameters by reference as the default (which means it passes a
pointer to the data). So, you're passing a pointer to a pointer at the
moment, which is why it is not working.
Just pass the integer values...
Crispin.
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]
On Behalf Of Larry Ducie
Sent: Tuesday, February 24, 2009 9:54 PM
To: RPG400
Subject: RPG -to- C (writing IBM IWS client code)
Hi guys, gals,
We have been playing with the Integrated Web Service for i
(w-03.ibm.com/systems/i/software/iws/index.html) and we have had some
successes.
However...
We have created a test service (from a RPG service program) which takes 2
input parms and returns a result. The service requires the input data to be
sent as a complex type. Thus, the C stubs generated has the input data as a
struct containing 2 pointers - each pointing to a long integer.
C Signature:
extern PR_MULTIPLY01Result* pr_multiply01(AXISCHANDLE pStub,
PR_MULTIPLY01Input* Value0);
C Structure:
typedef struct PR_MULTIPLY01InputTag {
xsdc__decimal* _LP_INPNUM01;
xsdc__decimal* _LP_INPNUM02;
} PR_MULTIPLY01Input;
RPG:
D TempInF DS
D pvalue1 * inz(%addr(value1))
D pValue2 * inz(%addr(value2))
// Initialize input values.
value1 = %dec(TEMP1:20:0);
value2 = %dec(TEMP2:20:0);
// Invoke the ConvertTemp Web service operation.
ResultP = pr_multiply01(WsStubP:%Addr(TempInF));
Could you please advise how best to pass my two 20i 0 values as the second
parm to this procedure?
I currently have a DS containing 2 pointers (each pointing to a long int)
and I pass the address of the DS. This does not work.
Any help would be most appreciated. Particularly if you have worked with
complex types in a IWS client and have already cracked this one.
Cheers
Larry Ducie
_________________________________________________________________
It's simple! Sell your car for just $50
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2
Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fa
i%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT
As an Amazon Associate we earn from qualifying purchases.