× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I am very confused. I want to call a service program from Java. The Java
code looks like this:

public boolean login() throws LoginException {

ServiceProgramCall sPGMCall = null;
AS400 system = null;
AS400Text txtCnv = new AS400Text(10);

try {
ProgramParameter[] parameterList = new
ProgramParameter[1];
parameterList[0] = new
ProgramParameter(txtCnv.toBytes(check_program));
AS400.setPasswordExpirationWarningDays(-1);
system = new AS400(auth_server, user, password);
sPGMCall = new ServiceProgramCall(system);
QSYSObjectPathName fullSrvPgmName = new
QSYSObjectPathName("%LIBL%", "ALSRVWRP", "SRVPGM");
sPGMCall.setProgram(fullSrvPgmName.getPath(),
parameterList);
sPGMCall.setProcedureName("AUTHORIZED_PGM_WRP");
sPGMCall.setReturnValueFormat(ServiceProgramCall.RETURN_INTEGER);
if (sPGMCall.run() != true) {
AS400Message[] messageList =
sPGMCall.getMessageList();
[......]

I copied this setup (defining an AS400Text object, and using method
toBytes on that object to define the parameter) from numerous pages on the
internet. However, when I do a debug on service program ALSRVWRP, all I
see is gibberish (some ASCII characters way out of the normal range).

What on earth is wrong with this code?

Ewout

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.