Aracılığıyla paylaş


sqloptions:applicationName üstbilgi öğesi

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:applicationName login option enables the istemci to specify the name of the application used for the login, for example:

<SOAP-ENV:Header
  xmlns:SOAP-ENV="https://schemas.xmlsoap.org/soap/envelope/"
  xmlns:sqloptions="https://schemas.microsoft.com/sqlserver/2004/SOAP/Options">
  <SOAP-ENV:Header>
    <sqloptions:applicationName SOAP-ENV:mustUnderstand="1" value="application name" />
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
       
  </SOAP-ENV:Body>
</SOAP-ENV:Header>

The sqloptions:applicationName login option appears as a SOAP header.Adlı bir öğe oluşur sqloptions:applicationName. Öğe bir zorunlu öznitelik sahiptir... value. Bu öznitelik dize.The value öznitelik gives the "application name" to küme for the login.Bu yer program_adı sütunsys.sysprocesses uyumluluk görüntüleyin.

Yalnızca örnek sqloptions:applicationName isteğe bağlı üstbilgi tek bir SOAP isteğinde bulunabilir.Bu üstbilgi, bir SOAP yanıtında bulunamaz.Seçenek birden çok örneğini bir hata üretecektir.

Sunucu tanınan değerler aralık sınırlayabilir sqloptions:applicationName değeri.Bir istemci, izin verilen aralık dışında bir değer gönderir, sunucu değeri sessizce tanımlanmamış bir şekilde keser.

SOAP oturumların kullanılıyorsa, bu seçenek bir SOAP oturum başlatmak için kullanılan isteğinde görünmesi gerekir.Bu seçenek, herhangi bir istekle görünürse bir sqloptions:sqlSession Ayrıca içermeyen başlığıbaşlatma öznitelik, hata oluşur.

Aşağıdaki için şemanın bir parçası olan sqloptions:applicationName Seçenek:

<xs:element name="applicationName" form="qualified">
    <xs:annotation>
        <xs:documentation>
            Set the application name for the login.
        </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:attribute use="required" name="value" type="xs:string" form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    The application name to set for the login.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
</xs:element>

Örnekler

Kullanım örnekleri aşağıdadır sqloptions:applicationName istek ve yanıt iletilerinde SOAP üstbilgisi.

Isteği

<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:applicationName SOAP-ENV:mustUnderstand="1" value="HeadTrax" />
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <sql:sqlbatch>
      <sql:BatchCommands>
         SELECT DISTINCT program_name FROM sysprocesses
         WHERE program_name='HeadTrax'
      </sql:BatchCommands>
    </sql:sqlbatch>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Yanıt

<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>
        <sqlresultstream:SqlRowSet xsi:type="sqlsoaptypes:SqlRowSet">
          <diffgr:diffgram xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1">
             <SqlRowSet1 xmlns="urn:schemas-microsoft-com:sql:SqlRowSet1">
                <row>
                  <program_name>HeadTrax</program_name>
                </row>
             </SqlRowSet1>
          </diffgr:diffgram>
        </sqlresultstream:SqlRowSet>
        <sqlresultstream:SqlRowCount xsi:type="sqlrowcount:SqlRowCount">
          <sqlrowcount:Count>1</sqlrowcount:Count>
        </sqlresultstream:SqlRowCount>
      </sql:sqlbatchResult>
    </sql:sqlbatchResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

See Also

Reference