Permits a web service to set an HTTP option in the result.
sa_set_http_option( optname, val )
optname Use this CHAR(128) parameter to specify a string containing the name of one of the HTTP options.
val Use this LONG VARCHAR parameter to specify the value to which the named option should be set.
Use this procedure within statements or procedures that handle web services to set options within an HTTP result set.
The supported options are:
CharsetConversion Use this option to control whether the result set is to be automatically converted from the character set of the database to the character set of the client. The only permitted values are ON and OFF. The default value is ON. See Using automatic character set conversion.
AcceptCharset Use this option to specify the HTTP server preferences for the character sets used in an XML, SOAP, and HTTP web service.
The syntax for this option conforms to the syntax used for the HTTP Accept-Charset request-header field specification in RFC2616
Hypertext Transfer Protocol. That is, permitted values are character set labels. For example, sa_set_http_option( 'AcceptCharset', 'UTF-8, Shift_JIS' )
. You may also include a quality value (q) for a character set label, indicating the degree of preference. For example, sa_set_http_option( 'AcceptCharset', 'UTF-8; q=0.9, Shift_JIS' )
.
The final list of acceptable character sets is an intersection of the values in the client's Accept-Charset HTTP request-header field, and the values in the server AcceptCharset option. The quality values specified in the client request are respected such that the most preferred character set specified by the client is used when possible. Following are some possible scenarios for determining the list of acceptable character sets:
SQL Anywhere also allows you to specify a plus sign (+) to indicate the server preference for using the database character
set if possible. For example, sa_set_http_option( 'AcceptCharset', 'UTF-8, +' )
. When specified, if the list of character sets in the client Accept-Charset request-header field includes the database character
set, that character set is automatically used, regardless of any quality values, and regardless of the order of matches found.
This minimizes the need for character set conversion.
SessionId Use this option to supply a name for an HTTP session. For example, sa_set_http_option( 'SessionId', 'my_app_session_1' )
sets the ID for an HTTP session to my_app_session_1. SessionId must be a non-NULL string. For more information about HTTP
sessions, see Using HTTP sessions.
None
None
Send feedback about this page via email or DocCommentXchange | Copyright © 2008, iAnywhere Solutions, Inc. - SQL Anywhere 11.0.0 |