Contents Index Starting a database server that listens for web requests Procedures that handle web requests

ASA Database Administration Guide
  Using the Built-in Web Server

How URLs are interpreted


The URIs used to access web services follow the pattern familiar to you from browsing the web. Users browsing through a database server need not be aware that their requests are not being handled by a traditional stand-alone web server.

Although they don't look unusual, URIs are necessarily interpreted a bit differently when sent to an Adaptive Server Anywhere database server. In addition, they are interpreted differently depending on which options you specified when you started the database server. The general syntax of the URL is as follows:

http | https } ://host [ :port ] [ /dbn ] /service-name [ parameters ] [ ?query ]

Host and port 

Like all standard http requests, the start of the URL contains the host name or IP number and, optionally, a port number. The IP address or host name, and port, should be the one on which your server is listening. The address will be the address of a network card in the machine running Adaptive Server Anywhere. The port number will the port number you specified using the -xs option when you started the database server. If you did not specify a port number, the default port number for that type of service is used. For example, the server listens by default on port 80 for HTTP requests.

For more information, see Network communications parameters.

Database name 

The next token, between the slashes, is usually the name of a database. This database must be running on the server and must contain web services.

The database name can be omitted only if the database server is running only one database, or if the database name was specified using the dbn parameter to the -xs switch.

Service name 

The next portion of the URL is the service name. This service must exist in the specified database. The service name may extend beyond the next slash character because web service names can contain slash characters. Adaptive Server Anywhere matches the remainder of the URL with the defined services.

If the URL provides no service name, the database server looks for a service named root. If the named service, or the root service, are not defined, the server returns a 404 Not Found error.

Parameters 

Depending on the type of the target service, parameters are supplied can be supplied in different ways. Parameters to HTML, XML, and RAW services can be passed in any of the following ways:

Parameters to SOAP and DISH services must be included as part of a standard SOAP request. Values supplied in other ways are ignored.

To access parameter values, parameters must be given names. These host variable names, prefixed with a colon (:) may be included in the statement that forms part of the web service definition.

For example, a statement that calls the procedure place_order may require product identification number and size parameters:

call place_order( :product, :quantity )
Query 

The query is a list of name = value pairs separated by the & character. This list is introduced by a question mark. GET requests are formatted in this manner. If present, the named variables are defined and assigned the corresponding values.

If you have URL PATH set to ON or ELEMENTS, additional variables are defined. However, the two are otherwise independent. You can define variables using a query, by setting PATH to ON or ELEMENTS, or both.

For more information about variables, see Working with variables.


Contents Index Starting a database server that listens for web requests Procedures that handle web requests