Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umaritimus/9c38abebf01b42789e61911f70f11b30 to your computer and use it in GitHub Desktop.
Save umaritimus/9c38abebf01b42789e61911f70f11b30 to your computer and use it in GitHub Desktop.
Execute Jolt transaction from outside PeopleSoft Application server. What kind of Payload does it accept?
String host = "AppServer";
String port = "9000";
String oprid = "PS";
String client = "JoltPing";
String joltPwd = "password";
byte[] data = "who goes there?".getBytes();
try {
JoltSessionAttributes jsa = new JoltSessionAttributes();
jsa.setString(jsa.APPADDRESS, "//" + host + ":" + port);
jsa.setInt(jsa.IDLETIMEOUT, 3000);
jsa.setInt(jsa.SENDTIMEOUT, 3000);
jsa.setInt(jsa.RECVTIMEOUT, 3000);
System.out.println(jsa.JoltClientVersion().toString());
session = new JoltSession(jsa, oprid, client, null, joltPwd);
if (session.isAlive()) {
/*
// This works for GETALL, but doesn't work for GetCertificate because
// I have no idea what payload should look like
service = new JoltRemoteService(".GETALL", session);
service.setString("PATTERN", "SVC/[A-Z]*");
*/
service = new JoltRemoteService("GetCertificate", session);
service.setBytes("PURCHASE", data, data.length);
System.out.println("Jolt Service Name: " + service.getName());
System.out.println("Jolt Service Type: " + service.toString());
service.call(null);
service.done();
session.endSession();
}
} catch (SessionException sessionExeption) {
System.err.println(sessionExeption);
} catch (ServiceException serviceException) {
System.err.println(serviceException);
session = null;
} catch (ApplicationException applicationException) {
System.err.println(applicationException);
service = null;
session = null;
}
@umaritimus
Copy link
Author

Notice "PURCHASE" parameter. Somebody has been really lazy renaming the delivered parameters in the example code while designing PeopleSoft 3-tier transactional code in the 1990s. And it's still here in the jrepository catalog in 2016. Unbelievable....

Anyone knows what i can throw into "data" in this -> byte[] data = "who goes here?".getBytes(); Anything i tried so far, simply generates bea.jolt.ApplicationException: TPESVCFAIL - application level service failure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment