Re: RPC mechanism to call AS400 programs from a 64-bit Windows client
"Greg Staton" <gstaton-L/8pyBllQdHWdkgYRFbIFlaTQe2KTcn/@public.gmane.org> Thu, 5 Aug 2010 10:52:05 -0400
| Newsgroups | gmane.comp.systems.as400.jbausers |
|---|---|
| Message-ID | <003001cb34ad$c5e978b0$51bc6a10$@com> |
Dan, You can also use FTP to call programs on the iSeries from a Windows based machine in DOS. Once you establish the FTP connection to the iSeries, this is an example of the FTP command to perform the iSeries call: quote rcmd call pgm(?lib?/?pgm?) There may be a service on the iSeries that will need started, but it works well once you get it working. In other words, it may take some trial and error to get it working the first time. Regards, Greg Staton -----Original Message----- From: system21-bounces-Zwy7GipZuJhWk0Htik3J/[email protected] [mailto:system21-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]] On Behalf Of Lee Greenwood Sent: Thursday, August 05, 2010 3:50 AM To: System 21 Users Subject: Re: [SYSTEM21] RPC mechanism to call AS400 programs from a 64-bit Windows client Hi Dan, While we've never used the JBA supplied chpm1cad.dll, I have written programs in VB6 that use the Client Access Object Library to call AS400 programs and update data in files. As you're talking about reverse-engineering the function I'm assuming that you or someone in your organisation could transpose this VB code into C or whatever PC side language you use. First, you need to add the Client Access Object Library dll to your project references. The dll is usually installed as part of the Client Access installation and should be in C:\Program Files\IBM\Client Access\Toolkit\Typelib and is called cwbautsv.tlb Once you have declared that, you need to add a few parameters to the declarations area on the VB6 project Dim dbConn As New cwbDatabaseConnection Dim mySQL As New cwbDatabaseSQL Dim myDB2 As New cwbDatabaseDB2 Dim myFmt As New cwbDatabaseDataFormat Dim errObj As New cwbErrorMessage Dim mySys As New cwbRemoteCallConversation Dim myCmd As New cwbCommand To be frank, I had to guess my way round how these things are supposed to function, so I've got no real technical explanation about what they actually do. If I have a file on the system for example QGPL/USERS which has 3 fields USERID, DESC, USRCLS to add or update records, I would use the code below (this code would be at the start of a sub routine) errObj.cwbsvSetup 'this lets you capture errors dbConn.cwbdbSetup "SYSNAM", errObj 'SYSNAM is the name of the system used when setting up the client access profile dbConn.convert65535 = True dbConn.cwbdbStartServer errObj myDB2.cwbdbSetup dbConn, errObj myDB2.cwbdbOverrideFile "QGPL", "USERS", "USERS", "MYFILE", errObj 'the first 2 parms are the library and filename, the 3rd is the file member name, the 4th is the name you want to use in the update/add mySQL.cwbdbSetup dbConn, myFmt, errObj (this code would add records to the file, you need to include values for all the fields in the file) mySQL.cwbdbExecuteImmediate "SQL1", "INSERT Into MYFILE Values('LEE', 'Lee Greenwood','Secofr') (this code would update a record) mySQL.cwbdbExecuteImmediate "SQL1", "UPDATE MYFILE Set USRCLS='USER' where USERID='LEE'" To call a program you only need 2 lines to make the connection errObj.cwbsvSetup mySys.cwbrcStartConversation "SYSNAM", "SOMERANDOMTEXT" 'Again parm 1 is the AS400 name defined when you setup Client Access on the PC, the 2nd parm seems a bit pointless Then this line to run the command myCmd.cwbrcRunCmd mySys, "CLRPFM FILE(QGPL/USERS)", errObj To call a program with parameters myCmd.cwbrcRunCmd mySys, "CALL LIB/PGM PARM('x' 'y')", errObj Hope this helps Lee. -----Original Message----- From: system21-bounces-Zwy7GipZuJhWk0Htik3J/[email protected] [mailto:system21-bounces-Zwy7GipZuJhWk0Htik3J/[email protected]] On Behalf Of Dan Thomas Sent: 04 August 2010 21:54 To: SYSTEM21-Zwy7GipZuJhWk0Htik3J/[email protected] Cc: Brad Hudson Subject: [SYSTEM21] RPC mechanism to call AS400 programs from a 64-bit Windows client Is anyone using a generic RPC mechanism to call AS400 programs from a 64-bit Windows client (Windows Server 2003 64-bit Standard Edition is what we are using)? We purchased eSupply from JBA years ago. We are no longer on support and even back then support for eSupply was limited. We have developed our own eCommerce applications, but still use an eSupply dll named chpm1cad.dll. We do have RPG source code for JBA, but not for this dll. We use three functions within the dll to a) make a connection to a proxy program on the AS400 (named jbachp), b) pass in the AS400 program name and parameters to it, and c) close the connection to the proxy. The current problem we are having is that IIS running on 64-bit windows is returning an error when we try to call the 32-bit dll. Hopefully I'll be able to write a wrapper to get around that, but if not, our best bet is probably to find a generic RPC mechanism for the AS400 that has a 64-bit Windows client component. In a worst-case scenario, if the jbachp proxy was providing some vital function that a generic RPC doesn't handle, we could always reverse-engineer the client side and completely replace the dll. I don't think the format of the data sent over the wire is very complicated, aside from a possible ASCII to EBCDIC conversion (which might be done in the server side proxy instead). Dan Thomas Vice President RxCrossroads Office: 502-213-1208 Cell: 502-296-8045 Fax: 502-753-8356 dthomas-mrcD0Lj1qui0m/[email protected] <mailto:dthomas-mrcD0Lj1qui0m/[email protected]> This information transmitted is intended only for the person or entity to which it is addressed and may contain confidential and/or privileged material, the disclosure of which is governed by applicable law. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is prohibited. If you received this in error, please contact me and destroy the materials contained in this message. _______________________________________________ This is the System 21 Users (SYSTEM21) mailing list To post a message email: SYSTEM21-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/system21 or email: SYSTEM21-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/system21. ********************************************************************* Titan Europe PLC Registered in England No. 301 8340 Registered Office: Bridge Road, Cookley, Kidderminster, Worcestershire, United Kingdom. DY10 3SD ********************************************************************* Please note that the Company reserves the right to monitor both incoming and outgoing e-mails and therefore the sender and recipient of such e-mails should have no expectation of privacy in this regard. _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp _______________________________________________ This is the System 21 Users (SYSTEM21) mailing list To post a message email: SYSTEM21-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/system21 or email: SYSTEM21-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/system21. _______________________________________________ This is the System 21 Users (SYSTEM21) mailing list To post a message email: SYSTEM21-Zwy7GipZuJhWk0Htik3J/[email protected] To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/system21 or email: SYSTEM21-request-Zwy7GipZuJhWk0Htik3J/[email protected] Before posting, please take a moment to review the archives at http://archive.midrange.com/system21.