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

SQL Anywhere 11.0.1 (Français) » SQL Anywhere Server - Programming » SQL Anywhere Data Access APIs » SQL Anywhere web services » Creating web service client functions and procedures

 

Modifying HTTP headers

When creating a web service procedure using the CREATE PROCEDURE statement, if you specify an HTTP HEADER name with no colon (:) and no value, the HTTP client application suppresses the header. If you include a colon but do not provide a value, the HTTP client application includes the header name, but no value. For example:

CREATE PROCEDURE suds(...)
TYPE 'SOAP:RPC'
URL '...'
HEADER 'SOAPAction\nDate\nFrom:';

In this example, the Action and Date HTTP headers, which are automatically generated by SQL Anywhere, are suppressed, and the From header is included but with no value.

Modifying automatically generated headers, can have unexpected results. The following HTTP headers are typically automatically generated and should not be modified without very careful consideration.

HTTP header Description
Accept-Charset Always automatically generated. If changed or deleted, may result in unexpected data conversion errors.
ASA-Id Always automatically generated. Ensures client does not connect to itself (that is to the same server) which may result in deadlock.
Authorization Automatically generated when URL contains credentials. If changed or deleted, may result in failure of the request. Only BASIC authorization is supported. User and password information should only be included when connecting via HTTPS.
Connection Connection: close, is always automatically generated. Client does not support persistent connections. Should not be changed or connection may hang.
Host Always automatically generated. HTTP/1.1 servers are required to respond with 400 Bad Request if an HTTP/1.1 client does not provide a Host header.
Transfer-Encoding Automatically generated when posting a request in chunk mode. Removing this header or deleting the chunked value will result in failure when the client is using CHUNK mode.
Content-Length Automatically generated when posting a request and not in chunk mode. This header is required to tell the server the content length of the body. If the content length is wrong the connection may hang or data loss could occur.