다음을 통해 공유


sqloptions:clientNetworkID 헤더 요소

sqloptions:clientNetworkID 로그인 옵션을 사용하면 클라이언트가 로그인에 사용할 클라이언트 네트워크 ID를 지정할 수 있습니다. 예를 들면 다음과 같습니다.

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

sqloptions:clientNetworkID 로그인 옵션은 SOAP 헤더로 나타나며 sqloptions:clientNetworkID라는 한 요소로 구성됩니다. 이 요소는 value라는 base64 인코딩 형식의 이진 값을 유일한 특성으로 가집니다. 이 요소는 로그인에 대해 설정할 수 있는 클라이언트 네트워크 ID를 제공하며 sys.sysprocesses 호환성 뷰의 net_address 열에 표시됩니다.

sqloptions:clientNetworkID 옵션은 한 요청에서 한 번만 나타날 수 있습니다. 이 헤더는 응답에는 나타날 수 없습니다. 이 옵션이 여러 개 나타나면 오류가 발생합니다.

서버에서 인식할 수 있는 sqloptions:clientNetworkID 값의 범위를 제한할 수 있습니다. 클라이언트가 허용된 범위를 벗어나는 값을 전송하면 서버에서 정의되지 않은 방식으로 해당 값을 자동으로 자릅니다.

SOAP 세션을 사용하고 있는 경우 이 옵션은 sqloptions:sqlsession initiate 특성과 같은 요청에 나타나야 합니다. sqloptions:sqlSession 헤더가 있으며 initiate 특성이 포함되지 않은 요청에 이 옵션이 나타나면 오류가 발생합니다.

다음은 sqloptions:clientNetworkID 옵션에 대한 스키마의 일부분입니다.

<xs:element name="clientNetworkID"  form="qualified">
    <xs:annotation>
        <xs:documentation>
            Set the client network ID for the login.
        </xs:documentation>
    </xs:annotation>
    <xs:complexType>
        <xs:attribute
          use="required"
          name="value"
          type="xs:base64Binary"
          form="unqualified">
            <xs:annotation>
                <xs:documentation>
                    The client network ID to set for the login.
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
</xs:element>

다음은 SOAP 요청 및 응답 메시지 내에 sqloptions:clientNetworkID 헤더를 사용하는 예입니다.

요청

<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:clientNetworkID SOAP-ENV:mustUnderstand="1" value="AAAAADreaLE=" />
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <sql:sqlbatch>
      <sql:BatchCommands>
        SELECT TOP 1 net_address FROM sysprocesses WHERE spid=@@spid
      </sql:BatchCommands>
    </sql:sqlbatch>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

응답

<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>
                <net_address>value specified in the request</net_address>
              </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>

참고 항목

참조

SOAP 확장 헤더

도움말 및 정보

SQL Server 2005 지원 받기