Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 12.0.0 (Français) » SQL Anywhere Server - Programming » HTTP web services » Accessing web services using web clients » Developing web client applications » Web client function and procedure requirements and recommendations


HTTP request header management

HTTP request headers can be added, changed, or removed with the HEADER clause of the CREATE PROCEDURE and CREATE FUNCTION statements. You suppress an HTTP request header by referencing the name. You add or change an HTTP request header value by placing a colon after the header name following by the value. Header value specifications are optional. For more information, see Web client SQL statements.

For example, run the following statement in the web client database to create an procedure named MyOperation that sends requests to the specified URL that puts restrictions on HTTP request headers:

    URL 'HTTP://localhost:8020/dbname/SampleWebService'
    HEADER 'SOAPAction\nDate\nFrom:\nCustomAlias:John Doe';

In this example, the Date header, which is automatically generated by SQL Anywhere, is suppressed. The From header is included but is not assigned a value. A new header named CustomAlias is included in the HTTP request and is assigned the value of John Doe.

Folding of long header values is supported, provided that one or more white spaces immediately follow the \n.

The following example illustrates long header value support:

    URL 'HTTP://localhost:8020/dbname/SampleWebService'
    HEADER 'heading1: This long value\n is really long for a header.\n

You must set the SOAPAction HTTP request header to the given SOAP service URI as specified in the WSDL when creating a SOAP function or procedure.

 Automatically generated HTTP request headers