
SG24-4935-00 Unleashing AS/400 Applications on the Internet June 1997 IBM International Technical Support Organization SG24-4935-00 Unleashing AS/400 Applications on the Internet June 1997 Take Note! Before using this information and the product it supports, be sure to read the general information in Appendix C, “Special Notices” on page 275. First Edition (June 1997) This edition applies to Version 3 Release 2 and Version 3 Release 7 of the Operating System/400 (5763-SS1) and (5716-SS1). Comments may be addressed to: IBM Corporation, International Technical Support Organization Dept. JLU Building 107-2 3605 Highway 52N Rochester, Minnesota 55901-7829 When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. Copyright International Business Machines Corporation 1997. All rights reserved. Note to U.S. Government Users — Documentation related to restricted rights — Use, duplication or disclosure is subject to restrictions set forth in GSA ADP Schedule Contract with IBM Corp. Contents Figures . ix Tables . xi Preface . xiii The Team That Wrote This Redbook ........................ xiii Comments Welcome . xv Chapter 1. AS/400 System in Network Computing Environment ....... 1 1.1 What is the Internet ................................ 1 1.2 History of Internet ................................. 2 1.3 Network Computing . 3 1.4 Why Attach an AS/400 System to the Internet? ................ 4 Chapter 2. Internet Application Design Considerations .............. 5 2.1.1 Network-Centric Computing . 5 2.2 AS/400 Internet Application Scenarios ..................... 5 2.3 Different Web Models ............................... 6 2.3.1 Simple Web Model .............................. 6 2.3.2 Interactive Web Model ............................ 7 2.3.3 Distributed Web Model ............................ 8 2.3.4 Enterprise Distributed Web Model ..................... 9 2.4 AS/400 System Facilities for the Internet .................... 10 2.4.1 Database Services . 10 2.4.2 Application Access . 10 2.4.3 Content Authoring . 11 2.4.4 Content Management . 11 2.4.5 Java Development Environment ...................... 12 2.5 General Design Considerations ......................... 12 2.5.1 Transactions over the World Wide Web using the Internet ....... 12 2.5.2 Synchronization between Web Browser and Server .......... 12 2.5.3 End User Driven ................................ 13 2.5.4 End User Anonymous ............................. 13 2.5.5 Status of User Requests ........................... 14 2.5.6 National Characters, Code Pages, Date Format ............. 15 2.5.7 Internet - Intranet - Extranet Considerations ............... 16 2.5.8 Internet Application Error Recovery .................... 17 2.6 Programming Alternatives . 17 2.7 Internet Programming Models .......................... 18 2.7.1 HTTP CGI Programming Model ....................... 19 2.7.2 Java Applet Communicating to CGI .................... 21 2.7.3 Net.Data Macros . 21 2.7.4 The Internet Client/Server Programming Model ............. 21 2.7.5 Lotus Domino . 22 2.8 Supporting the AS/400 Legacy Programming Models ............ 22 2.8.1 The 5250 Workstation Gateway ....................... 22 2.8.2 ″On-the-Fly″ Translation versus the Toolkit Approach ......... 23 2.8.3 Telnet and Client Access - Personal Communication ......... 24 2.9 HTML Programming Considerations ...................... 24 2.9.1 Hypertext Markup Language (HTML) ................... 25 2.9.2 The HTML Document Structure ....................... 25 Copyright IBM Corp. 1997 iii 2.9.3 HTML Syntax . 27 2.9.4 Creating Static HTML Pages ........................ 29 2.9.5 Feedback .................................... 30 2.10 Server Side Imagemap Support ........................ 30 2.10.2 Server Side Image Maps Considerations ................ 35 2.11 Netscape, Microsoft IE, IBM Web Explorer, Spyglass .......... 35 2.12 ILE Integrated Language Environment Programming Considerations . 35 2.12.1 Overview of ILE Concepts ......................... 35 2.12.2 ILE Compile and Bind Commands .................... 38 2.12.3 OPM Compatibility Mode .......................... 39 2.12.4 Activation Groups . 39 2.12.5 Activation Group Recommendations ................... 41 2.12.6 Differences Between Default and Non-Default Activation Groups .. 41 2.12.7 Migration to ILE from the Original Programming Model ....... 42 2.13 IFS - Integrated File System Considerations ................. 43 2.13.1 Short Overview of Various File Systems in IFS ............. 43 2.13.2 Which AS/400 File System Works Best? ................. 44 2.13.3 How to Exchange Data Between the Root or QOpenSys and QSYS.LIB . 46 2.14 Java Programming Considerations ...................... 47 2.14.1 Java Scripts being Served from AS/400 System ............ 47 2.14.2 Java Applets being Served from AS/400 System ............ 48 2.14.3 Java Applications being Executed on AS/400 Java Virtual Machine 48 2.14.4 Using NetRexx to Create Java Applets .................. 49 2.14.5 Using Perl to Create Java Applets .................... 50 2.14.6 Using VisualAge for Java to Create Applets and Applications .... 52 2.15 Application Security Considerations ...................... 53 2.15.1 Related Publications ............................. 53 2.16 Internet URL References for More Information ................ 54 2.17 Road Map for Internet Application Design .................. 56 Chapter 3. Common Gateway Interface (CGI-BIN) Implementation ....... 57 3.1 HTTP CGI Programming Model ......................... 57 3.2 Considerations Before You Start ......................... 60 3.2.1 Required Configuration . 61 3.2.2 Overview of the Communication Between CGI Programs and the Server . 61 3.3 CGI-BIN Programming . 63 3.3.1 HTML Form Tags ............................... 67 3.4 GET Method . 69 3.5 POST Method . 71 3.6 AS/400 Programming Languages Supported ................. 73 3.7 Decoding the Parameters from the Remote Web Client ........... 74 3.7.1 CGI Parameter String Syntax ........................ 75 3.8 Programming CGI-BIN with ILE C/400 ...................... 76 3.8.1 Structure of C Program with POST Method ................ 77 3.8.2 CGI Parameter Parsing with ILE C/400 .................. 77 3.8.3 ILE C Sample Programs using POST and GET Methods ........ 78 3.9 Programming CGI-BIN with ILE RPG/400 and ILE COBOL/400 ....... 82 3.9.1 Structure of RPG Program Using POST Method ............. 82 3.9.2 CGI Parameter Parsing with ILE COBOL/400 or RPG/400 ....... 86 3.9.3 ILE RPG Program Using the POST and GET Methods ......... 87 3.10 Programming CGI with REXX Language ................... 93 3.10.1 Structure of REXX Program Using POST Method ............ 94 3.11 Examples for Environment Variables ..................... 99 iv Unleashing AS/400 Applications on the Internet 3.12 ITSO Company Example ............................ 102 3.12.1 Source Code RPG Program ORDAS400G ............... 103 3.12.2 Source Code RPG Program ORDAS400P ............... 107 3.12.3 Source Code C Program PARSECGIP ................. 108 Chapter 4. Net.Data Implementation . 111 4.1 An Overview of Net.Data for AS/400 System ................. 111 4.1.1 Beyond DB2WWW Connection ...................... 112 4.1.2 Features and Functions .......................... 112 4.1.3 Generalized Data Sources ......................... 113 4.1.4 Advanced Macro Language ........................ 113 4.1.5 Net.Data and Internet Security ...................... 114 4.2 Writing Net.Data Macro Files .......................... 114 4.2.1 Define Section . 117 4.2.2 Function Definition Section ........................ 118 4.2.3 HTML INPUT Section ............................ 119 4.2.4 HTML OUTPUT Section ........................... 121 4.3 Generating HTML in a Web Macro ...................... 122 4.3.1 HTML Blocks . 122 4.4 Web Macro Functions .............................. 124 4.4.1 Define Functions . 124 4.4.2 Calling Functions . 125 4.4.3 Net.Data Built-In Functions ........................ 129 4.4.4 Table Variables . 131 4.4.5 Implicitly Defined Variables ........................ 132 4.5 Report Blocks . 134 4.5.1 Message Blocks . 136 4.6 Language Environments . 139 4.6.1 REXX (DTW_REXX) Language Environment ............... 139 4.6.2 SQL (DTW_SQL or SQL) Language Environment ........... 141 4.6.3 SYSTEM (DTW_SYSTEM) Language Environment ........... 144 4.7 Net.Data Advanced Macro Language Examples .............. 145 4.7.1 Multiple HTML Sections .......................... 146 4.7.2 Using Include Files ............................. 146 4.7.3 Conditional Logic . 147 4.7.4 Maintaining State using ″HTML″ Hidden Variables .......... 147 4.7.5 Net.Data Hidden Variables ......................... 150 4.7.6 Net.Data Predefined Variables ...................... 151 4.7.7 Net.Data Environment Variables ..................... 152 4.7.8 Net.Data Default Report .......................... 153 4.8 Additional Tips . 154 4.8.1 Net.Data Error Messages ......................... 156 4.9 Getting Net.Data Up and Running ....................... 159 4.9.1 Example URL Calling Net.Data Macro .................. 165 4.10 Migrating from DB2 WWW Connection to Net.Data ............ 166 4.11 Debug HTTP Server Setup for Net.Data ................... 166 4.12 Service and Support .............................. 168 Chapter 5. HTML Gateway Implementation .................... 169 5.1 What is an HTML Gateway? .......................... 170 5.2 Using the HTML Gateway in Application Development .........
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages308 Page
-
File Size-