Udostępnij przez


sqloptions:notificationRequest element nagłówka

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 klient to specify the query powiadomienie 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.W nagłówku składa się z jednego elementu o nazwie 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.Aby uzyskać więcej informacji na temat używania sqloptions:notificationRequest Opcja w powiadomieniach kwerendy, zobacz subskrybować powiadomień kwerendy za pomocą nagłówek protokołu SOAP.

Tylko jedno wystąpienie sqloptions:notificationRequest opcji mogą być wyświetlane na żądanie.Opcja nie pojawia się w odpowiedzi.Wiele wystąpień opcji spowoduje wygenerowanie błędu.

Poniżej przedstawiono fragment schematu dla sqloptions:notificationRequest Opcja:

<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>

Po określeniu tego nagłówka będzie wymagane subskrypcja powiadomień kwerendy.Aby uzyskać więcej informacji zobaczZa pomocą kwerendy powiadomień.

Przykłady

Poniżej podano przykłady używania sqloptions:notificationRequest Nagłówek w komunikatach żądanie i odpowiedź SOAP.

Żądanie

<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>

Odpowiedź

<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