Web Protocols: Requests/Responses

Web clients and servers communicate by using a request/response protocol called HTTP, which is an acronym for Hypertext Transfer Protocol. HTTP includes two methods for retrieving and manipulating data: GET and POST.

GET Retrieves data from the server. The target of the request (referred to as a resource) is specified as a URI (Uniform Resource Identifier). This is usually (but not always) an absolute reference to a file on the server and is referred to as a URL (Uniform Resource Locator) when used in this context. Additional parameters, called Query Parameters, can also be specified.
POST Posts data back to the server. In addition to a URL and query parameters, a POST request includes a payload. The payload is usually form data, the aggregated contents of the various fields (also called controls) that were in the response.

There are other methods (HEAD, PUT, DELETE), but the above two are the ones used by BIS for SOAP based web services. The other methods are available for REST-based web services.

The general form of a URL is familiar to anyone who has used a web browser:

http:// host [:port] / [absolute_path [ ? query_parameters ] ]

where:

http:// Indicates that the Hypertext Transfer Protocol is being used to make the request. In a URI, this is referred to as the scheme. BIS supports two schemes: http and https (secure http).
host The name or location of the computer that will receive the request.
port

An optional integer that specifies the port on the server that will receive the request. If omitted, this defaults to 80 for the http scheme, and 443 for the https scheme.

The combination of host and port (along with host headers, which is a scheme that allows a single host to serve multiple domains) specifies a unique web server.

absolute_path The absolute location of the resource being requested on the host. This is frequently (but not always) the name of a file. Note that the base directory is not the root directory of the file system, but the root directory of the web tree that is being served by the host on the specified port.
query_parameters Optional parameters that are made available to the web server and to the service program.

To summarize, a client (web browser or program using SOAP) sends an HTTP request to the web server. The request contains a method (GET or POST), a URI that specifies the file or resource that is being requested, optional query parameters, and optional form data (if a POST).

If the resource being requested is a resource that is associated with BIS by the web server, for example, a .srf file (sometimes also called a stencil), then all of the above information (request type, URI, query parameters, form data) is passed to the BIS Request Handler, which then renders (that is, executes) the tags in that file. If BIS renders a StartService tag, a COBOL service program is started. If BIS subsequently renders an XMLExchange tag, the request is sent to the COBOL program, and the COBOL program's response is rendered into the HTTP response text that is returned to the user agent (browser, SOAP consumer, etc.).