|
I am still having trouble calling a simple java program from RPG. Below is
what my java class looks like:
public class PostOutBoundXml {
public void postXml(String arg) {
try {
String endpoint =
"http://localhost/axis/services/SancaXmlService";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress(new
URL(endpoint));
call.setOperationName("postXml");
call.invoke(new Object[] {arg});
} catch (Exception e) {
e.printStackTrace();
}
}
}
Here is my prototype:
D postXml PR EXTPROC(*JAVA:
D 'us.co.state.judicial.sanca.+
D client.iseries.+
D PostOutBoundXml':'postXml')
D* strObj O Class(*JAVA:'java.lang.String')
*********************************************************************
* newString constructor that accepts a byte array
* (an alphnumeric variable in RPG speak). It
* returns a string object.
*********************************************************************
D newString PR O ExtProc(*JAVA:
D 'java.lang.String':
D *CONSTRUCTOR)
D Class(*JAVA:'java.lang.String')
D charParm 100A
I have commented out the input String parameter for prototype postXml
because the RPG program will not compile: The error is "The call passed
fewer parameters than the prototype indicates are required." However, if I
comment out the input param, everything compiles fine but I get an exception
"java.lang.NoSuchMethodError: postXml" when calling method "postXml" with
signature "()V" in class. Below is the RPG:
H DftActGrp(*NO) ActGrp(*CALLER)
/Copy *LibL/QRpgLeSrc,XmlOutPR
D strObj S O CLASS(*JAVA:'java.lang.String')
D string S 100A
C/FREE
string = '<TEST>';
strObj = newString(string);
postXml(strObj);
Eval *inLR = *on;
/END-FREE
Any help would be greatly appreciated. I am about to pull my hair out with
this stuff.
Thanks,
Chad Cornelius, IIS
(720) 921-7835
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.