Created
April 7, 2016 18:07
-
-
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 generatesbea.jolt.ApplicationException: TPESVCFAIL - application level service failure