× 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.



To try to fix a problem we are having with socket communications, it was suggested that we call a module from Java using PCML before we call our usual program. I received the following info from the Java developer and after reading the message he gets, I think I understand the problem, but we are under the gun on this process and you East Coasters may be able to give us an answer before we get back in the office.

It looks to me that the problem is that you can only call a module when the path points to a service program that contains the module. Is this correct? I do not know at this time if the module the vendor wanted us to call is part of a service program, but I will be checking on that too.

Are we calling the module correctly? We have not previously tried to call modules from Java using PCML

Thanks for the help.

Dave

Problem details:


<pcml version="4.0">

<!-- RPG module: VSFDRESET -->

<!-- created: 2009-02-02-13.46.01 -->

<!-- source: DAVEM/DAVESRC(VSFDRESET) -->

<!-- 1000014 -->

<program name="VSFDRESET" entrypoint="VSFDRESET" returnvalue="integer">

<data name="ACTIONCD" type="char" length="1" usage="input" />

<data name="IPADDR" type="char" length="30" usage="inputoutput" />

<data name="PORTN" type="int" length="4" precision="31" passby="value" usage="input" />

</program>

</pcml>





When I run the program the "integer" gives me fits. The code below complile without any errors, it errors when it executes.

This is the error I get "pe.getMessage()"= "Attribute, returnvalue="integer", only allowed when path= attribute specifies a service program object. Processing <program> element "VSFDRESET"." When the call statement is executed...





pcml2 = *new* ProgramCallDocument(sys2, "VSFDRESET");


// Path to correct library //A BR02027

*if* (EnvName.equals("PRD")) { //A BR02027

pcml2.setPath("VSFDRESET", "/QSYS.LIB/SHP4VAR270.LIB/VSFDRESET.PGM"); //A BR02027

} *else* { //A BR02027

pcml2.setPath("VSFDRESET", "/QSYS.LIB/SHP4VAR270.LIB/VSFDRESET.PGM"); //A BR02027
} //A BR02027



pcml2.setValue("VSFDRESET.ACTIONCD", "O");

pcml2.setValue("VSFDRESET.IPADDR", "172.16.146.86");

pcml2.setValue("VSFDRESET.PORTN", "2000");



// Call VSRDRESET API

*boolean* rc = *false*;

String returnVarsity = "";

rc = pcml2.callProgram("VSFDRESET"); // program name

returnVarsity = (String) pcml2.getValue("VSFDRESET.INTEGER");



*catch* (PcmlException pe)

{

pe.printStackTrace();

IN60 = *true*;

*this*.MSGDTA.moveLeftPad(pe.getMessage());

*this*.MSGID.moveLeftPad("CPF9898"); // Package number &1 does not exist.

}

*catch* (Exception pe)

{

pe.printStackTrace();

IN60 = *true*;

*this*.MSGDTA.moveLeftPad(pe.getMessage());

*this*.MSGID.moveLeftPad("CPF9898"); // Package number &1 does not exist.

}




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.