Udostępnij przez


sqloptions:initialLanguage 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:initialLanguage SOAP header enables the klient to specify the initial language to zestaw, 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:initialLanguage          SOAP-ENV:mustUnderstand="1"          value="name of initial language to use"           optional="true" | "false" />

</SOAP-ENV:Header>

The sqloptions:initialLanguage option appears as a SOAP header.W nagłówku składa się z jednego elementu o nazwie sqloptions:initialLanguage. Element ma jeden atrybut obowiązkowy, value. Jest to ciąg znaków.The value atrybut specifies the name of the initial language to zestaw. Ciąg jest interpretowane tak samo, jak język zestaw Transact-SQL Instrukcja. Element ma jeden atrybut opcjonalny, optional. Jest to logiczny (wartość domyślna to false). Atrybut opcjonalny Określa, czy błąd połączenia z bazą danych ulegnie awarii identyfikator logowania: false oznacza identyfikator logowania ulegnie awarii. true oznacza identyfikator logowania może być kontynuowany.

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

Jeśli sesje SOAP są używane, ta opcja musi pojawić się w jednym żądaniu jako Zainicjuj sqloptions:sqlsession atrybut. Jeśli ta opcja pojawia się w żądaniu, każdy z sqloptions:sqlSession nagłówka, który nie zawiera także Inicjowanie atrybut, błąd jest generowany.

Poniżej przedstawiono fragment schematu dla sqloptions:initialLanguage option:

<xs:element name="initialLanguage" form="qualified">
    <xs:annotation>
        <xs:documentation>
            Set initial language to set.
        </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:attribute use="required" name="value" type="xs:string" form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    The name of the initial language to set.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
        <xs:attribute
          name="optional"
          default="false"
          type="xs:boolean"
          form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    Whether the initial language is optional or not.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
</xs:element>

Przykłady

Poniżej podano przykłady używania sqloptions:initialLanguage 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:initialLanguage SOAP-ENV:mustUnderstand="1" value="us_english" optional="true"/>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <sql:sqlbatch>
      <sql:BatchCommands>
        SELECT @@language AS lang
      </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>
        <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>
                <lang>us_english</lang>
              </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