sqloptions:notificationRequest Header Element

This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature.

The sqloptions:notificationRequest option enables the client to specify the query notification to trigger for the request, for example:

<SOAP-ENV:Header
  xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
  xmlns:sqloptions="https://schemas.microsoft.com/sqlserver/2004/SOAP/Options">
    <sqloptions:notificationRequest 
          SOAP-ENV:mustUnderstand="1"
          timeout="timeout value in seconds" 
          deliveryService="name of delivery service" />

</SOAP-ENV:Header>

The sqloptions:notificationRequest option appears as a SOAP header. The header is made up of one element, named sqloptions:notificationRequest. The element has two mandatory attributes, notificationId and deliveryService, and one optional attribute, timeout. notificationId and deliveryService are both text values, and timeout is an xsd:integer value. For more information about how to use the sqloptions:notificationRequest option in query notifications, see Using a SOAP Header to Subscribe to Query Notifications.

Only one instance of the sqloptions:notificationRequest option can appear in a request. The option cannot appear in a response. Multiple instances of the option will generate an error.

The following is a schema fragment for the sqloptions:notificationRequest option:

<xs:element name="notificationRequest" form="qualified">
    <xs:annotation>
        <xs:documentation>
            Requests query notifications for the request.
        </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:attribute
          use="required"
          name="notificationId"
          type="xs:string"
          form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    The notification identifier.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute
          use="required"
          name="deliveryService"
          type="xs:string"
          form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    The deliveryService.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute name="timeout" type="xs:integer" form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    The timeout value.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
</xs:element>

When this header is specified, a subscription for query notifications will be requested. For more information, see Using Query Notifications.

Examples

The following are examples of using the sqloptions:notificationRequest header within SOAP request and response messages.

Request

<SOAP-ENV:Envelope xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:sql="https://schemas.microsoft.com/sqlserver/2004/SOAP"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns:sqlparam="https://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlParameter"
                   xmlns:sqlsoaptypes="https://schemas.microsoft.com/sqlserver/2004/SOAP/types"
                   xmlns:sqloptions="https://schemas.microsoft.com/sqlserver/2004/SOAP/Options">
  <SOAP-ENV:Header>
    <sqloptions:notificationRequest notificationId="notification"
                                    timeout="1"
                                    deliveryService="deliveryService" >
    </sqloptions:notificationRequest>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <sql:sqlbatch>
      <sql:BatchCommands></sql:BatchCommands>
    </sql:sqlbatch>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Response

<SOAP-ENV:Envelope xml:space="preserve" 
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
                   xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/" 
                   xmlns:sql="https://schemas.microsoft.com/sqlserver/2004/SOAP" 
                   xmlns:sqlsoaptypes="https://schemas.microsoft.com/sqlserver/2004/SOAP/types" 
                   xmlns:sqlrowcount="https://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlRowCount" 
                   xmlns:sqlmessage="https://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage" 
                   xmlns:sqlresultstream="https://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream" 
                   xmlns:sqltransaction="https://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlTransaction" 
                   xmlns:sqltypes="https://schemas.microsoft.com/sqlserver/2004/sqltypes">
  <SOAP-ENV:Body>
    <sql:sqlbatchResponse>
      <sql:sqlbatchResult>
      </sql:sqlbatchResult>
    </sql:sqlbatchResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

See Also

Reference