How to Create HTTP Web Services

HTTP web services are classified as HTML, XML or RAW. All HTTP web services can be created or altered using the same CREATE SERVICE and ALTER SERVICE statement syntax.

Example

Execute the following statement in Interactive SQL to create a sample general HTTP web service in the HTTP web server:

CREATE SERVICE SampleWebService
    TYPE 'web-service-type-clause'
    URL OFF
    USER DBA
    AUTHORIZATION OFF
    AS sql-statement;

The CREATE SERVICE statement creates a new web service named SampleWebService and returns the result set of sql-statement. You can replace sql-statement with either a SELECT statement to select data from a table or view directly, or a CALL statement to call a stored procedure in the database.

Replace web-service-type-clause with the desired web service type. Valid clauses for HTTP web services include HTML, XML, RAW and JSON.

You can view the generated result set for the SampleWebService service by accessing the service in a web browser.