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

SQL Anywhere 10.0.1 » SQL Anywhere Server - Programming » SQL Anywhere Web Services » Creating web service client functions and procedures

Creating web service client functions and procedures Next Page

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.

Accept-CharsetAlways automatically generated. If changed or deleted, may result in unexpected data conversion errors.
ASA-IdAlways automatically generated. Ensures client does not connect to itself (that is to the same server) which may result in deadlock.
AuthorizationAutomatically 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.
ConnectionConnection: close, is always automatically generated. Client does not support persistent connections. Should not be changed or connection may hang.
HostAlways 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-EncodingAutomatically 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-LengthAutomatically 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.