Contents Index Quick start Starting a database server that listens for web requests

ASA Database Administration Guide
  Using the Built-in Web Server

Creating web services


You create web sites by creating services within databases. Services define which URIs are valid and what they do. A single database can define multiple services.

The facilities available through your Adaptive Anywhere web server are defined in databases. Services, created and stored in databases, define which URIs can be used and what they do. A single database can define multiple services. It is possible to define services in different databases so that they appear to be part of a single web site.

Three statements are provided that permit you to create, alter, and delete web services:

The general syntax of the CREATE SERVICE statement is as follows:

CREATE SERVICE service-name TYPE service-type-string [ attributes ] [ AS statement ]

Service names 

As service names will form part of the URI used to access them, they are flexible in terms of what characters they can contain. In addition to the standard alpha-numeric characters, the following characters are permitted: "-", "_", ".", "!", "*", "'", "(", and ")".

In addition, service names may contain the slash, "/", but some restrictions apply because this character is a standard URI delimiter and affects how Adaptive Server Anywhere interprets your URIs. It cannot be the first character of a service name. In addition, service names cannot contain two consecutive slashes.

Service types 

The following service types supported:

Of the types HTML, XML, and RAW, RAW gives you the most control over the output. However, it does require that you do more work as you must explicitly output all the necessary tags. XML format can be tuned to some extent using an assortment of built-in procedures.

For more information, see CREATE SERVICE statement.

Statements 

The statement is the command, usually a stored procedure, that is called when someone access the service. If you define a statement, this is the only statement that can be run through this service. The statement is mandatory for SOAP services, and ignored for DISH services. The default is NULL, which means no statement.

You can create services that do not include statements. The statement is taken from the URI. Services configured in this way can be useful when you are testing a service, or want a general way of accessing information. To do so, either omit the statement entirely or use the phrase AS NULL in place of the statement.

Services without statements are a serious security risk, as they permit web clients to execute arbitrary commands. When creating such services, you must enable authorization, which forces all clients to provide a valid username and password. Even so, only services that define statements should be run in a production system.

Attributes 

The following attributes are available. In general, all are optional. However, some are interdependent.


Contents Index Quick start Starting a database server that listens for web requests