Plex 2E

Expand all | Collapse all

Call Plex RPG programs on iSeries from Java. How?

  • 1.  Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 02:48 AM
    Dear collective wisdom,
    we have a set of RPG programs developed with Plex installed on our iSeries. We would like to call those programs from a Tomcat server running Java. Our collaborators use those programs through IIS and WCF by having a job Plex610 in iSeries listening on port 3906. However, we wish to use Java but documentation on how to do so is difficult to find on the web. Hence, a few questions.
    [list]
    [*]What is the protocol used to communicate with Plex610?
    [*]If it is proprietary or based on WCF, is there a way we can expose those programs as web services?
    [*]In general, what is the best practice to call Plex RPG programs from Java?
    [list]We are familiar with jt400. However, we would prefer using SOAP instead of jt400.


  • 2.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 06:53 AM
    •What is the protocol used to communicate with Plex610?
    TCP/IP protocol

    •If it is proprietary or based on WCF, is there a way we can expose those programs as web services?
    jt400 at current site and Websydian TransacXML (Plex pattern from websydian) to expose plex functions as SOAP services at the other sites.
    •In general, what is the best practice to call Plex RPG programs from Java?
    All depends on what approach you take. You could add a further Plex tier ie a WCF generated by Plex or a Plex Generated Java function that calls the RPG which means the communication to the as400 is handled by a plex function.


  • 3.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 07:44 AM
    Hello George,
    thank you for your helpful response. As you might surmise by the elementary nature of my questions, I have no experience with Plex. We have an application created by a another company deployed to our iSeries server and we need to figure out how to integrate with it.

    GeorgeJeffcock wrote:

    All depends on what approach you take. You could add a further Plex tier ie a WCF generated by Plex or a Plex Generated Java function that calls the RPG which means the communication to the as400 is handled by a plex function.
    If I understand this correctly, one can generate a Java wrapper that can be used to calls the Plex generated RPG function using jt400. That would be perfect for us. We use a similar approach to call COBOL applications (created with Rational Business Developer) running on iSeries.

    GeorgeJeffcock wrote:

    You need to have look at the supplied help for PLEX, not online, as it contains alot of the info that will help but also good to ask here.
    Unfortunately, we only have the deployed application but no Plex development tools available. I was hoping I could find the manual online.


  • 4.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 08:49 AM
    Two Keys points I take are:
    We have an application created by a another company deployed to our iSeries server and we need to figure out how to integrate with it.
    Keep in mind these Plex generated Functions are just rpg functions anything you find on "How to call RPG from Java" is approiate as long as the Plex runtime library is in the Library list.

    we only have the deployed application but no Plex development tools available
    Therefore creating a new tier in Plex (WCF or Java or Websydain TransacXML) is not an option.

    Looks like "one can generate a Java wrapper that can be used to calls the Plex generated RPG function using jt400. That would be perfect for us. We use a similar approach to call COBOL applications (created with Rational Business Developer) running on iSeries. "

    See 97806170

    this might be of interest also 18399568


  • 5.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 09:07 AM


  • 6.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 03:35 PM

    GeorgeJeffcock wrote:

    Keep in mind these Plex generated Functions are just rpg functions anything you find on "How to call RPG from Java" is approiate as long as the Plex runtime library is in the Library list.
    Yep. That is a good remark. In fact, in another effort I have experimented with calling RPG generated by Plex from COBOL generated by RBD/EGL. No luck so far, but that is another story that probably involves activation groups, ILE vs OPM, etc. But I'll try to solve the connection from Java first.

    The sentence "you get any java platform invoking Plex generated RPG PGM via Plex IBM i dispatcher" in the discussion you linked sounds exactly what we need to do. I'll need to visit our collaborators and take a look at the documentation on Plex java Platform guide.


  • 7.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 10:05 AM
    Hi,

    You mention that this is a third party app deployed on your iSeries. Do you have the RPG source code for the programs you need to call? If so, you can generate a SOAP based web service front end using Rational Business Developer (I think this version includes this functionality). There is a web service wizard that does the work for you. It works off of the something called a PCML file that can be generated when you compile an RPG program. From the PCML file, it generates a SOAP based java web service. We do this currently using WDSC. One thing I'm not sure about is if the generated java can be deployed to Tomcat instead of Websphere.

    Another option for calling the RPG program also involves using the PCML file. I read an article about an open source PCML Object Mapper utility. The source can be found at https://gethub.com/dweibel/pcml-om. I haven't used it, but I thought it might be an option for you.

    Dean Eshleman,
    Everence Financial


  • 8.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 03:47 PM
    Hi Dean,
    I am sure we will get the RPG source code if needed. Rational Business Developer ships with installer for iws, but I have not tried it yet. In some documentation I read that using the Integrated Web Services for i uses Java and running Java on i has been something we do not wish to do due to poor Java performance on i. Thus, I have already given some thought to this alternative but we would prefer a solution that does not require Java on i.

    I believe that the integrating i with Java platform would be easier with Websphere than with Tomcat. However, being a small company this far we have not wanted to invest in Websphere even if it is better supported in RBD than Tomcat.


  • 9.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Jan 02, 2013 06:55 AM
    You need to have look at the supplied help for PLEX, not online, as it contains alot of the info that will help but also good to ask here.


  • 10.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Feb 25, 2013 08:39 AM
    I have been perusing the CA Plex for Java platform manual. The front page is promising: Java Client Application calls RPG/400 in iSeries. However, the manual seems to be built on the idea that the Java Client Application is coded using Plex and server functions are called from Plex environment. But we plan to call server functions from hand coded Java.

    I can call RPG programs from Java as follows:
    import com.ibm.javart.calls.PowerServer;
    import com.ibm.javart.calls.PowerServerImpl;
    
    public void test() {
    
    PowerServer myPowerServer = null;
    
    try  {
    
    
    myPowerServer = new PowerServerImpl();
    
    
    RPGPRGWrapper wrapper = new RPGPRGWrapper(myPowerServer);
    
    
    wrapper.execute();
    
    
    System.out.println("result: " + wrapper.getEnvironment());
    
    }
    
    catch (Exception e) {
    
    
    System.out.println(e.getMessage());
    
    }
    }
    There are probably other ways to call RPG programs as well, but this has worked for us when calling COBOL programs and I assume RPG programs can be called similarly. Writing the wrapper has to be created manually from an interface, but it is trivial with our development tools. We'll only need to take care of library list on the iSeries.

    This is through jt400, not Plex610 dispatcher. If I use Plex610 dispatcher I get error CPD0018 String ' ' contains a character that is not valid so apparently this is not the correct way to call the program. The question is, is the any added value in calling the program through Plex610 dispatcher instead of just calling RPG using jt400? And, in case there is, how do I call it from hand-written Java?


  • 11.  RE: Call Plex RPG programs on iSeries from Java. How?
    Best Answer

    Posted Feb 25, 2013 02:07 PM
    Hi,
    The question is, is the any added value in calling the program through Plex610 dispatcher instead of just calling RPG using jt400? And, in case there is, how do I call it from hand-written Java?
    There is no value to implement that way. And I think it is impossible to implement it without knowing Plex runtime source code.
    The Dispatcher is meant to accept call from other Plex runtime platform request (from Non-IBM i platform), such WINC, .NET, Java functions or plex.exe for remote compile.
    There are many predefine data contract before calling the program. Which CA don't open to public.

    SO your approach using local jt400 is reasonable and best for me.

    Regards,
    kiyoshi


  • 12.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Feb 25, 2013 02:18 PM
    I would agree no advantage using the dispatcher. Current client's java tier uses jit400 BUT are excited about the wcf option and the plex team offering soap and wsdl as the jit400 is a little painful to maintain and implement so are looking to rewrite.

    When considering wcf there is the issue of interobabilty with some of the bindings with java but am told it is doable... And anything is better than jit400 or in our case use the open source version. Will post our findings.

    Sorry re read the post and see this is not applicable.


  • 13.  RE: Call Plex RPG programs on iSeries from Java. How?

    Posted Feb 26, 2013 01:25 AM
    Thanks to all for helping me sort this out. We will use jt400 as that is something we know well and ditch the dispatcher.