26
Thu, Dec
0 New Articles

Integrating ASP with the AS/400

Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Active Server Pages (ASP) is a Web application framework that was introduced by Microsoft as part of its Internet and server business strategy. ASP is included with Windows NT 4.0 Server as an extension to Microsoft’s Internet Information Services (IIS), Microsoft’s Web server solution.

Over the last three years, ASP has become remarkably popular and the trend is continuing. ASP’s popularity is primarily due to its simplicity, ease of use, and the common availability of ASP development tools. The following are some benefits of ASP:

• The ability to combine scripting (VBScript and JScript) with HTML
• Built-in objects for Web server information exchange
• Installable components that provide prebuilt functionality for writing sophisticated e-Commerce/Web applications

• Simple, straightforward access to databases In addition, ASP’s intrinsic support for Microsoft’s Component Object Model (COM) and the new COM+ architecture that Microsoft is developing for Windows 2000 has resulted in a large ASP add-on component market similar to what was witnessed with Visual Basic at one point. These factors, along with the popularity of ASP development tools such as Macromedia’s Drumbeat 2000 (www.drumbeat.com/) and Microsoft’s Visual InterDev (msdn.microsoft.com/vinterdev/), have greatly contributed to ASP’s tremendous success.

But, despite most developers’ love for ASP, those same developers are painfully aware of ASP’s greatest limitation: it runs on only one operating system platform and Web server—Windows NT 4.0 with IIS. The majority of Internet and intranet servers are hosted on non-Windows NT platforms, largely due to concerns over Windows NT’s scalability and reliability. Given these facts, the problem becomes obvious. On one hand, developers are lured by the ASP development environment, its toolsets, and the benefits ASP provides a Web site. On the other hand, Webmasters and server administrators are cringing at the thought of deploying mission-critical e-commerce applications on anything other than their perfectly suited, high-end servers. The simplest solution is to make ASP deployment possible on all platforms, including the AS/400.

To solve this need for a cross-platform ASP, I will discuss Halcyon Software’s Instant ASP (iASP) product and how it can be used to deploy ASP applications on an HTTP Server for AS/400 Web server using IBM’s WebSphere Application Server. I will


look at what iASP is, how to install and configure it on your AS/400, and how to get started running ASP applications on your HTTP server.

Instant ASP—ASP for AS/400

Instant ASP is a cross-platform ASP deployment solution. iASP is built as a Java servlet and, as a result, can run ASP applications with any Web server on any Java-enabled platform, including the AS/400. iASP replicates and extends the ASP environment by providing support for scripting, built-in objects, installable components, several third-party components, intrinsic support for external Java binaries, connectivity to remote COM/DLL binaries from AS/400, CORBA (Visigenic) and Enterprise JavaBeans support, and more. All the objects, components, and add-ons are built as JavaBeans to ensure portability.

So, how does iASP work? On the AS/400 platform, iASP gets attached to WebSphere as a servlet. The WebSphere product is connected to the IBM HTTP Server. When a request from a client (Web browser) comes in for an ASP application (or page—typically indicated by the .asp extension), the HTTP Server sends a request to WebSphere, which passes the request to the iASP engine. iASP processes the application page, executes the embedded scripts, computes the results, and returns the HTML data to the HTTP server. The HTTP server then transmits the HTML back to the client.

iASP’s AS/400 System Requirements

In the next few sections, I will review iASP installation on the AS/400 platform. Before doing so, I’ll take a quick look at the system requirements for running iASP on your AS/400 system.

It is highly recommended that you install WebSphere 1.1 and Java Development Kit (JDK) 1.1.7 on your AS/400. Older versions of these products may work, but they have not been tested with iASP. To get iASP running for the first time under OS/400, I installed the product on OS/400 V4R3 and followed the process detailed in this article. However, the instructions listed here should work the same way on OS/400 V4R4 or any IBM WebSphere-based environment. Newer OS/400 V4R4 systems ship with this recommended configuration. For V4R3 systems, you can order WebSphere from IBM, but be sure to install the prerequisite PTFs on your AS/400 first. Systems older than V4R3 have not been tested. Simply put, in order to run iASP, you must have a Web server that supports Java servlets. In addition to the OS/400 software, you will need a copy of iASP Developer edition (limited to two concurrent connections), available free of charge from Halcyon Software at www.halcyonsoft.com.

Configuring iASP on AS/400

Start by mapping the AS/400 system from your installation Windows system so that it is accessible (with write permissions) from the Windows Explorer. This can be done by using the Client Access for Windows 95/NT network drive function or by using AS/400 NetServer to map a drive to the root (/) directory of your AS/400 Integrated File System (AS/400 IFS).

Next, install iASP on your Windows system in an appropriate folder. (I’ll use c:iasp for this example.) Once iASP is installed on the local system, using Windows Explorer, copy the entire c:iasp folder over to the proper folder on the networked drive you created in the last paragraph. (I created another folder called /iasp in the root (/) directory of the AS/400 IFS.)

The next step is to add iASP to your WebSphere servlet setup. Start the WebSphere Manager applet by pointing your Web browser to its URL on the AS/400 system (typically http://:9090/). Do the following steps:
1. Click on the Setup button and add the following lines to the Java Classpath textbox (Figure 1). Doing so adds all the files you have installed your AS/400 IFS /iasp/lib/ folder. The following are the files to be added:


/iasp/lib/iasplib.jar:/iasp/lib/iasp_chart.jar:

/iasp/lib/iasp_image.jar:/iasp/lib/iasp_exec.jar:

/iasp/lib/iasp_sock.jar:/iasp/lib/iasp_mail.jar:

/iasp/lib/iasp_pop3.jar:/iasp/lib/rjax.jar:/iasp/

lib/classes

2. Click on the Servlets button and add iASP to the list of WebSphere servlets, as shown in Figure 2. Use the following parameters:

Servlet Name = iasp

Servlet Class = jhost.jaspservlet.jaspServlet

Once you add iASP as a servlet and click on the Test Servlet button, WebSphere will load the servlet and run some tests on it. The final results should indicate that the servlet has passed all the tests. The iASP servlet is now registered in the WebSphere servlet list. Note that you should not turn on the Bean Servlet option since iASP is not a Bean- based servlet.
3. Click on the Servlet Aliases option (Figure 3, page 24) and add an alias for the .asp extension mapped to the newly added iASP servlet. Doing so will program WebSphere to route all requests for .asp files to the iASP servlet. The text to add the extension is the following:

*.asp iasp

Configuring the HTTP Server

Now that WebSphere is ready to route .asp requests to iASP, it’s time to configure the HTTP server so that it will forward .asp requests to WebSphere. Use the following steps to configure the HTTP server:

1. Start the ADMIN server if not already started. This can be done by typing the Start TCP/IP Server (STRTCPSVR) command as follows:

STRTCPSVR SERVER(*http) HTTPSVR(*admin).

2. Go to the HTTP Server Administration pages by pointing your browser to the following URL: http://:2001/. (Note that 2001 is the default.) On the AS/400 Task screen that appears, click on the link for IBM HTTP Server for AS/400.

3. Click on the Configuration and Administration button and follow the Configurations/Request Processing/Request Routing dropdown path.

4. Enable HTTP support for ASP files (*.asp) by entering the following values on the Request Routing screen to add this entry:

• Click on the desired Index number in the table that you want to add this entry before or after by clicking on the Index dropdown and selecting the target routing index number.

• Select either the Insert Before or Insert After radio button to indicate whether you want to insert this entry before or after the index number you just selected.

• In the Action dropdown box, select Service from the dropdown menu.
• In the URL Template field, enter the following:

/*.asp

• In the Replacement File Path Field, enter

/QSYS.LIB/QHTTPSVR.LIB/QZHJSVLT.SVRPGM: AdapterService


• Leave all other fields as they are.
• Click on the Apply button to add this entry.
5. In order to access the samples under the /iasp folder, you will need to provide access to it through your HTTP server. This will also be done from the HTTP Server Administration page. Just add the /iasp folder in your accessible table

6. Shut down all instances of your WebSphere and IBM HTTP server by running the End TCP/IP Server (ENDTCPSVR) command as follows:

ENDTCPSVR SERVER(*HTTP) HTTPSVR(*ALL)

Depending upon how you have configured your HTTP server, this may or may not terminate the WebSphere. By default, this should bring down your WebSphere as well. Please refer to the WebSphere documentation for more information.

7. To restart the HTTP Server, enter the Start TCP Server (STRTCPSVR) command with the name of the particular server instances you want to start. To start all defined server instances, type in the command as follows:

STRTCPSVR SERVER(*HTTP) HTTPSVR(*ALL)

This is the last and perhaps the simplest step. However, it is this one step that somehow causes most problems. Simply put: if the servlet passed all the tests and you cannot run the samples, the problem is most likely with the .ASP routing, which means that either you made some typos or did not shut down the server properly. In my case, I spent a long time until I finally realized that the HTTP Server had other instances hanging around and therefore, was not being initialized with the modified properties.

Now that you have configured the system, I’ll move on to ASP execution.

Running ASP on AS/400

The moment of truth: Here’s when you will try to run some very simple ASP samples to verify whether iASP is functional. Point your browser to the http:///iasp/ URL. Follow the link to Samples and on to General. Click on the Run link for the HelloWorld sample next to the VBScript link. If you see an hourglass for an extended period of time, that’s a good sign that the script is being executed. The very first script execution will be slow. Consequent runs for all the VBScript related samples will be faster. The same principle holds true for JScript samples. They produce a slow initial run with faster executions later on.

The samples are provided to give you a very basic idea of the capabilities you have. In the interest of brevity, I will only mention those samples that demonstrate the extended capabilities provided by iASP.

One of these samples is named Tropics and it demonstrates the use of external Java classes as intrinsic ASP objects. A reference to an external Java object is created by this call:

set obj = server.CreateObject(“attrib”)

In this call, attrib.class is a Java class in the WebSphere Java Classpath. The ASP application can access its properties and methods using the same scripting syntax that it does with the built-in objects.

The Process sample is another interesting sample that shows how you can utilize your ActiveX or DLL binaries from your ASP application on the AS/400 system. You will need to install the R-JAX product on your Windows system to test this functionality. (RJAX makes Microsoft ActiveX, DLL, and COM components accessible to any Java


application running remotely or locally on any Java-enabled platform. More information on R-JAX is available at www.halcyonsoft.com/prods/r_jax/r_jax.htm.)

Finally, the ADO (Active Data Object) samples provide a complete introduction to building data-driven Web applications with ASP. Halcyon’s ADO implementation is compatible with Microsoft’s ADO. All the back-end plumbing is done using JDBC and can, therefore, support any database for which JDBC or ODBC drivers are defined. Clicking on the names of these samples will provide more information on the database schema and how to populate it in your environment. Once the database is prepared and populated, you will need to add the JDBC driver’s classes in the WebSphere Java Classpath, modify the database connection string appropriately in the ASP application, and restart the server. iASP also provides complete remote management and configuration capabilities from license management to object pooling and all the way up to log file management. All these properties are remotely configurable from iASP’s Remote Console Applet (Figure 4) using any Java-enabled Web browser.

What’s Next?

Lots! IBM has done a terrific job with Java support on the AS/400 platform, especially from a performance and portability standpoint. The first iASP execution, without ANY modification to our binaries, is ample proof of that. However, there is plenty more that is being done to improve and enhance iASP on the AS/400 platform. For instance, Halcyon is working on using the AS/400 Java Translator to convert iASP into a native AS/400 application, which will result in a performance boost to what is already a fast system. (The translation does not require the source code. I encourage you to try it out on your own. Read the AS/400 JDK documentation for more infromation on the translator and its usage.) Other enhancements in the areas of application server support, transaction server support, faster database connectivity, and more are also underway.

Related Materials

Halcyon Software Web site: www.halcyonsoft.com IBM’s HTTP Server for AS/400 Web page: www.as400.ibm.com/http IBM’s WebSphere Application Server for AS/400 Web page: www.as400.ibm.com/websphere AS/400 NetServer Web page: www.as400.ibm.com/netserver “Better AS/400 Web Sites Through Microsoft Technology?” Joe Hertvik, AS/400 Technology Showcase, September 1999 “WebSphere for AS/400 Setup,” Lisa Wellman, AS/400 NetJava Expert (Web Edition), February/March 1999, www.midrangecomputing.com/anje “WebSphere-related Resources,” Lisa Wellman, AS/400 NetJava Expert (Web Edition), February/March 1999, www.midrangecomputing.com/anje “WebSphere Application Server for AS/400,” Lisa Wellman, AS/400 NetJava Expert, February/March 1999 “AS/400 Servlets 101,” Sonjaya Tandon AS/400 NetJava Expert (Web Edition), February/March 1999, www.midrangecomputing.com/anje


Integrating_ASP_with_the_AS-_40006-00.jpg 445x376

Figure 1: WebSphere Application server management is also handled through a Web screen. This is the screen where you add Java classpaths.

Figure 2: iASP is added to your HTTP Server configuration as a servlet under the WebSphere application server.


Integrating_ASP_with_the_AS-_40006-01.jpg 445x397

Integrating_ASP_with_the_AS-_40007-00.jpg 445x397

Figure 3: Creating a server alias for your iASP servlet tells WebSphere to route all .asp file requests to the iASP servlet.


Integrating_ASP_with_the_AS-_40008-00.jpg 445x443

Figure 4: iASP properties are also configured from the Remote Console Applet.


BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: