I tried changing to what you suggested, but I am getting a TypeError.
This (the original approach) works:
var MyPdpClassStartup = java.newInstanceSync('ThirdPdp');
var testRequest = "XXXXXXXXXXXXXXXXXXXXX";
var responseToStartupRequest = java.callStaticMethodSync("ThirdPdp", "DoRequest", testRequest, "0000000", myDebug);
But, this doesn't work:
var myThirdPdpClass = java.import("ThirdPdp");
.
.
app.post('/zzzz/yyyy', function (req, res) {
var stringRequestMarker = ("000000" + requestMarker++).slice(-6);
newMyPdpClassInstance = new myThirdPdpClass();
var x = newMyPdpClassInstance.DoRequest(req.body, stringRequestMarker, myDebug);
The error I get is: TypeError: newMyPdpClassInstance.DoRequest is not a function
Also, FYI, if I output the "newMyPdpClassInstance" variable in a console.log after the "new", I get the value: ThirdPdp@2fc07784
So it seems like it is getting a reference to the instance (the "ThirdPdp@2fc07784"), but it doesn't seem to think that instance has a method named "DoRequest"?
Also, as you can see, I think the number of parameters in the call to the DoRequest() method is the same (3 string params).
Also, FYI, I have tried with both .DoRequest() and .DoRequestSync() and get the same error.
I also tried with another function in that class (.timestmp()) that takes no params and returns a string, and that gave a similar TypeError.
How can I debug this further?
Thanks,
Jim