0 pts.
 RPG Program calling Java
Ok guys I need some help. Our company just purchased a credit card verification software, its a Java application. I need to have an RPG/ILE program call this JSP passing and returning parms. I know very very little about Java, was wondering if anyone had examples of how to code this. Thanks John

Software/Hardware used:
ASKED: June 16, 2005  1:28 PM
UPDATED: October 26, 2009  6:26 AM

Answer Wiki:
Another iSeries user wrote the editors of Search400.com with this suggestion: First of all, ask your reseller for a correct (ie RPG, of course) running sample, or negotiate a rebate. Then you can try something like they did in these pages. (It is an HSSF Java project with RPG, working correctly but too expensive in processor resources.): http://www.iseriesnetwork.com/resources/artarchive/index.cfm?fuseaction=viewarticle&CO_ContentID=19278&channel=art&PageView=Search http://www.iseriesnetwork.com/resources/clubtech/index.cfm?fuseaction=ShowNewsletterIssue&ID=17839 http://www.iseriesnetwork.com/resources/clubtech/index.cfm?fuseaction=ShowNewsletterIssue&ID=19336 http://www.iseriesnetwork.com/resources/clubtech/index.cfm?fuseaction=ShowNewsletterIssue&ID=19277 -- Michelle Davidson, editor, Search400.com
Last Wiki Answer Submitted:  June 21, 2005  9:09 am  by  MichelleDavidson   110 pts.
All Answer Wiki Contributors:  MichelleDavidson   110 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Jason Hickmott also sent us these comments:

“The short answer is that a RPG program cannot call a JSP. You can construct a URL with parameters and parse the resulting HTML. I have done this recently in Java. In my case, the external application was designed to work this way. Usually this kind of solution is bad because it is similar to screen scraping. When the UI is changed, your application will break. My RPG is a little bit rusty so I?m not sure if there is an API for constructing URLs. Perhaps the IBM XML parser could be used to parse the HTML?

“Instead of a brittle HTML parsing solution and if your company can provide a Java resource, then perhaps you may wish to consider the following. A Java application can have different types of clients. The UI with its JSPs is one of them; your RPG application is another. An RPG program cannot directly invoke a Java class in a J2EE application. Instead you must go RPG -> Java ?> J2EE. The plain Java bit in the middle is deployed onto an AS/400. An example of this is the Business Delegate pattern (http://java.sun.com/blueprints/corej2eepatterns/Patterns/BusinessDelegate.html). All you need to do in your RPG application is call the Java methods as subprocedures.”

– Michelle Davidson, editor, Search400.com

 110 pts.

 

There does need to be some clarification. The question title is about “calling Java”. The question text asks how to “call this JSP”. Which is it?

Tom

 107,715 pts.