Returns a SOAP header entry, or an attribute value for a header entry of the SOAP request.
SOAP_HEADER( header-key [ index, header-attribute ] )
header-key This VARCHAR parameter specifies the XML local name of the top level XML element for a given SOAP header entry.
index This optional INTEGER parameter differentiates between SOAP header fields that have identical names. This can occur when multiple header entries have top level XML elements with the same localname. Usually, such elements have unique namespaces.
header-attribute This optional VARCHAR parameter can specify any attribute node within a header entry element, including:
@namespace A special SQL Anywhere attribute used to access the namespace of the given header entry.
mustUnderstand A SOAP 1.1 header entry attribute indicating whether a header entry is mandatory or optional for the recipient to process.
encodingStyle A SOAP 1.1 header entry attribute indicating the encoding style. This attribute may be accessed, but it is not used internally by SQL Anywhere.
actor A SOAP 1.1 header entry attribute indicating the intended recipient of a header entry by specifying the recipient's URL.
LONG VARCHAR
This function may be used with a single parameter header-key to return a header entry. A header entry is an XML string representation of an element, and all its sub-elements, contained within a SOAP header.
This function may also be used to extract a header entry attribute by specifying the optional index and header-attribute parameters.
This function returns the value of the named SOAP header field, or NULL if not called from a SOAP service. It is used when processing a SOAP request via a web service.
If a header for the given header-key does not exist, the return value is NULL.
SQL/2008 Vendor extension.
When used within a stored procedure that is called by an HTTP web service, the following example processes all the keys located in the SOAP request header. When it processes the Authentication key, it also obtains the key's value.
BEGIN DECLARE hd_key LONG VARCHAR; DECLARE hd_entry LONG VARCHAR; header_loop: LOOP SET hd_key = NEXT_SOAP_HEADER( hd_key ); IF hd_key IS NULL THEN -- no more header entries LEAVE header_loop; END IF; IF hd_key = 'Authentication' THEN SET hd_entry = SOAP_HEADER( hd_key ); END IF; END LOOP header_loop; END; |
![]() |
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |