Overview

Overview of Stored Process Web Applications

Stored processes are frequently used in Web-based applications. While almost any stored process can be executed through a Web interface, the typical Web application design might require special techniques. This chapter documents special issues that you might encounter when building a Web application.
Web applications are typically implemented by streaming output stored processes. Streaming output stored processes deliver their output through the _WEBOUT fileref. You can write directly to the _WEBOUT fileref by using PUT statements, or you can use the Output Delivery System (ODS) to generate output. The example code throughout this chapter demonstrates both approaches. The workspace server is not an appropriate host for many Web applications.
Web applications can be implemented using the SAS Stored Process Web Application, the Stored Process Service application programming interface (API), or a combination of both. The SAS Stored Process Web Application is a Java middle-tier application that executes stored processes on behalf of a Web client. Only SAS and HTML programming skills are required; no Java programming is required. Most of the examples in the remainder of this chapter assume the use of the SAS Stored Process Web Application. The Stored Process Service API enables the Java developer to embed stored processes within a Java Web application.

How the SAS Stored Process Web Application Works

The SAS Stored Process Web Application is a Java Web application that can execute stored processes and return results to a Web browser. The SAS Stored Process Web Application is similar to the SAS/IntrNet Application Broker, and it has the same general syntax and debugging options. The SAS Stored Process Web Application is included with the SAS Web Infrastructure Platform, which is a component of SAS Integration Technologies.
Request processing for the SAS Stored Process Web Application is similar to SAS/IntrNet Application Dispatcher request processing. Here's how the SAS Stored Process Web Application processes a request:
  1. Users enter information in an HTML form by using their Web browser and then submitting it. The information is passed to the Web server, which invokes the first component, the SAS Stored Process Web Application.
  2. The SAS Stored Process Web Application accepts data from the Web server and contacts the SAS Metadata Server for user authentication and retrieval of stored process information.
  3. The stored process data is then sent by the SAS Stored Process Web Application to a stored process server through the object spawner.
  4. The stored process server invokes a SAS program that processes the information.
  5. The results of the SAS program are sent back through the Web application and Web server to the Web browser of the user.
The following diagram illustrates this process:
Request Processing - Flow Diagram

SAS Stored Process Web Application Samples

The SAS Stored Process Web Application comes installed with a sample Welcome page and a set of sample stored processes. These samples illustrate various features that are available with stored processes. The Welcome page searches for the stored processes and displays them in a table. The Welcome page and sample custom input forms have been localized.
You can find the SAS source for the samples is in the SAS installation directory, which might look like the following path: /SAS/SASFoundation/9.3/inttech/sample
The sample custom input forms are located in the SAS Stored Process Web Application installation directory, which might look like the following path: /server/SASServer1/deploy_sas/sas.storedprocess9.3.ear/sas.storedprocess.war/input/Samples
The samples are registered in metadata at the following path: /Products/SAS Intelligence Platform/Samples/