Hi Everyone,
I am currently involved in enhancing an AS/400 application written in RPG,
which receives data in from a web application via data queues. The business
has decided to make this traffic two-way, and made a unilateral decision to
create a synchronisation service to prevent contention, accessed from the
As/400 via an RPC module written in Java.
As the only programmer in the department to have ever written any ILE RPG, I
was assigned to write the RPG to communicate with this Java procedure,
something I've never done before.
The class is defined in a package as com.axa.rpc.RpcClient, held in a JAR
file in an ifs folder on the machine.
I have used the ADDENVVAR command to set the CLASSPATH to point to the ifs
folder, and the following RPG code to define the required method to RPG
(sorry about the formatting)
D RpcClient PR O EXTPROC
(*JAVA:'com.axa.rpc.RpcClient'
D :'execute')
D STATIC
D CLASS(*JAVA:'java.lang.String')
D s_dest O CLASS(*JAVA:'java.lang.String')
D xml_call O CLASS(*JAVA:'java.lang.String')
*
* Call External Service using Remote Procedure Call
* -------------------------------------------------
*
D str S O CLASS(*JAVA:'java.lang.String')
D str2 S O CLASS(*JAVA:'java.lang.String')
D str3 S O CLASS(*JAVA:'java.lang.String')
*
* Java String Objects
* -------------------
*
D makestring PR O EXTPROC(*JAVA:'java.lang.String':
D *CONSTRUCTOR)
D CLASS(*JAVA:'java.lang.String')
D parm 65535A CONST VARYING
*
* Construct a Java string using input parameter
* ---------------------------------------------
and the following statement to call the method;
C eval str = makestring(xml_in)
C eval str2 = makestring(output)
C eval str3 = makestring('mainframe')
C eval str2 = RpcClient(str3 :str)
C eval xml_out = makealpha(str2)
The calls to the String constructor, and the makealpha (String.getBytes)
work fine, but the call to RpcClient gives Class Def Not Found error.
I'm sure its an environmental thing, but any solutions would be gratefully
received.
Regards,
Neil
_________________________________________________________________
MSN Instant Messenger now available on Australian mobile phones. Go to
http://ninemsn.com.au/mobilecentral/hotmail_messenger.asp
As an Amazon Associate we earn from qualifying purchases.