sqloptions:notificationRequest Element nagłówka
Ta funkcja zostanie usunięta z przyszłej wersji programu Microsoft SQL Server. Należy unikać stosowania tej funkcji w nowych projektach oraz zaplanować modyfikację aplikacji, w których obecnie jest używana ta funkcja.
Sqloptions:notificationRequest opcji umożliwia klient do określenia powiadomienie kwerendy wyzwalacza dla żądania, na przykład:
<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>
sqloptions:initialLanguage Opcja jest wyświetlana jako nagłówek protokołu SOAP.Nagłówek 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 opcji kwerendy powiadomień, zobacz Subskrybowanie powiadomień kwerendy za pomocą nagłówka protokołu SOAP.
Tylko jedno wystąpienie sqloptions:notificationRequest opcji mogą pojawiać się w żądaniu.Opcja nie pojawia się w odpowiedzi.Wiele wystąpień opcji zostanie wygenerowany błąd.
Oto fragment schematu dla sqloptions:notificationRequest opcji:
<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, zobacz Za pomocą kwerendy powiadomień.
Przykłady
Oto przykłady użycia sqloptions:notificationRequest nagłówek protokołu SOAP żądań i odpowiedzi wiadomości.
Żą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>