다음을 통해 공유


ScanAvailableEvent 요소

필수 ScanAvailableEvent 요소는 클라이언트가 구독된 검사 디바이스가 작업을 검색할 준비가 되었다는 것을 클라이언트에 알릴 수 있습니다.

사용량

<wscn:ScanAvailableEvent>
  child elements
</wscn:ScanAvailableEvent>

특성

특성이 없습니다.

자식 요소

요소
ClientContext
ScanIdentifier

부모 요소

부모 요소가 없습니다.

설명

WSD Scan Service는 사용자가 검사 대상을 선택하고 스캔 디바이스에서 검사를 시작한 경우 등록된 클라이언트에 ScanAvailableEvent 요소를 보냅니다.

클라이언트는 ScanAvailableEvent 이벤트를 수신하려면 WSD Scan Service를 사용하여 구독을 만들어야 합니다. 클라이언트는 wse:Subscribe> 요청 작업 요소를 통해 Scan Service에< 요청 메시지를 전송하여 구독을 만듭니다.

구독 요청에는 ScanDestinations 확장 요소에 하나 이상의 대상이 포함됩니다. Scan Service는 ScanAvailableEvent 알림을 보낼 때마다 이러한 대상을 사용하여 단일 클라이언트로 필터링합니다. 이 필터는 사용자가 스캔 단추를 누를 때 스캔 서비스가 모든 클라이언트에 알리지 않도록 방지합니다. 확장 요소는 WSD Scan Service 네임스페이스에 정의된 다음 wse:Subscribe> 요청 본문에< 추가됩니다.

WSD Scan Service가 구독 만들기에 대한 클라이언트의 요청을 수락하는 경우 서비스는 wse:SubscribeResponse> 응답 작업 요소로< 응답해야 합니다. 구독 응답에는 DestinationResponses 확장 요소에 하나 이상의 대상 응답이 포함되어 구독을 수락한 검사 디바이스에 연결하는 데 도움이 됩니다.

<wse:Subscribe><wse:SubscribeResponse> 요소는 사양에 설명되어 있습니다.

예제

다음 코드 예제에서는 클라이언트가 WSD Scan Service에서 ScanAvailableEvent 이벤트를 수신하도록 구독하는 방법을 보여 줍니다.

<soap:Envelope
    xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
    xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:wse="https://schemas.xmlsoap.org/ws/2004/08/eventing"
    xmlns:wscn="https://schemas.microsoft.com/windows/2006/01/wdp/scan>
    soap:encodingStyle='https://www.w3.org/2002/12/soap-encoding' >
  <soap:Header>
    <wsa:To>AddressofScannerService</wsa:To>
      <wsa:Action>
         https://schemas.xmlsoap.org/ws/2004/08/eventing/Subscribe
      </wsa:Action>
      <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
      <wsa:ReplyTo>
        <wsa:Address>https://www.example.com/MyEventSink</wsa:Address>
      </wsa:ReplyTo>
  </soap:Header>
  <soap:Body>
    <wse:Subscribe>
      <wse:Delivery>
        <wse:NotifyTo>
          <wsa:Address>
            https://www.example.com/MyEventSink/OnScanAvailableForMe
          </wsa:Address>
        </wse:NotifyTo>
      </wse:Delivery>
      <wse:Expires>P0Y0M0DT30H0M0S</wse:Expires>
      <wse:Filter xmlns:wscn="https://schemas.microsoft.com/windows/2006/01/wdp/scan">
        ScanAvailableEvent
      </wse:Filter>
      <wscn:ScanDestinations>
        <wscn:ScanDestination>
          <wscn:ClientDisplayString>Den Computer</wscn:ClientDisplayString>
          <wscn:ClientContext>App1ScanID2345</wscn:ClientContext>
        </wscn:ScanDestination>
      </wscn:ScanDestinations>
    </wse:Subscribe>
    </soap:Body
</soap:Envelope>

다음 코드 예제에서는 클라이언트의 구독 요청에 대한 WSD Scan Service의 응답을 보여 줍니다.

<soap:Envelope
    xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
    xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:wse="https://schemas.xmlsoap.org/ws/2004/08/eventing"
    xmlns:wscn="https://schemas.microsoft.com/windows/2006/01/wdp/scan">
    soap:encodingStyle='https://www.w3.org/2002/12/soap-encoding' >
  <soap:Header>
    <wsa:To>https://schemas.xmlsoap.org/ws/2003/03/addressing/role/anonymous</wsa:To>
    <wsa:Action>
      https://schemas.xmlsoap.org/ws/2004/08/eventing/SubscribeResponse
    </wsa:Action>
    <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
    <wsa:RelatesTo>uuid:MsgIdOfTheSubscribe</wsa:RelatesTo>
  </soap:Header>
  <soap:Body>
    <wse:SubscribeResponse>
        <wse:SubscriptionManager>
             <!-- Elements removed for clarity  -->
        </wse:SubscriptionManager>
        <wse:Expires>P0Y0M0DT30H0M0S</wse:Expires>
        <wscn:DestinationResponses>
          <wscn:DestinationResponse>
            <wscn:ClientContext>App1ScanID2345</wscn:ClientContext>
            <wscn:DestinationToken>Client3478</wscn:DestinationToken>
          </wscn:DestinationResponse>
        </wscn:DestinationResponses>
      </wse:SubscribeResponse>
    </soap:Body
</soap:Envelope>

다음 코드 예제에서는 WSD Scan Service가 ScanAvailableEvent를 클라이언트로 보내는 방법을 보여 줍니다.

<soap:Envelope
  xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
  xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
  xmlns:wse="https://schemas.xmlsoap.org/ws/2004/08/eventing"
  xmlns:wscn="https://schemas.microsoft.com/windows/2006/01/wdp/scan"
  soap:encodingStyle='https://www.w3.org/2002/12/soap-encoding'>

  <soap:Header>
    <wsa:To>AddressofEventSink</wsa:To>
    <wsa:Action>
      https://schemas.microsoft.com/windows/2006/01/wdp/scan/ScanAvailableEvent
    </wsa:Action>
    <wsa:MessageID>uuid:UniqueMsgId</wsa:MessageID>
  </soap:Header>

  <soap:Body>
    <wscn:ScanAvailableEvent>
      <wscn:ClientContext>App1ScanID2345</wscn:ClientContext>
      <wscn:ScanIdentifier>AnyUniqueIdentifierSuchAsAGUID</wscn:ScanIdentifier>
    </wscn:ScanAvailableEvent>
  </soap:Body
</soap:Envelope>

추가 정보

ClientContext

DestinationResponses

ScanDestinations

ScanIdentifier