다음을 통해 공유


WSD 스캔 서비스 작업 오류 보고

이 섹션에서는 WSD Scan Service에서 작업 오류 코드를 생성하고 보내는 방법을 설명합니다. 대부분의 작업이 반환할 수 있는 오류 코드는 일반적인 WSD 스캔 서비스 작업 오류 코드에 설명되어 있습니다.

WSD Scan Service에서 XxxRequest 작업을 처리하는 동안 오류가 발생하면 XxxResponse 요소 대신 오류 코드를 반환합니다. Scan Service는 soap:Fault> 요소의< 오류 코드를 반환합니다.

WSD 스캔 서비스 내에서 정의된 모든 오류 메시지는 웹 서비스 주소 지정(WS-Addressing) 사양에 설명된 규칙에 따라 전송되어야 합니다. 특히 WSD 스캔 서비스는 오류 메시지를 순서대로 다음 위치로 보내야 합니다.

  1. [오류 엔드포인트](있는 경우 유효한 경우)입니다.

  2. 그렇지 않으면 [회신 엔드포인트](있는 경우)입니다.

  3. 그렇지 않으면 [원본 엔드포인트]입니다.

엔드포인트는 모든 오류 메시지에 필요한 메시지 정보 헤더를 포함해야 합니다. 오류 메시지는 WS-Addressing에 정의된 [관계] 속성을 사용하여 회신으로 상관 관계가 지정됩니다. 다음 [action] 속성은 오류 메시지를 지정합니다.

https://schemas.xmlsoap.org/ws/2004/08/addressing/fault

오류 정의는 다음 속성을 사용합니다.

Fault 속성 정의
[코드] 오류 코드입니다.
[하위 코드] 오류 하위 코드입니다.
[이유] 영어 이유 요소입니다.
[세부 정보] detail 요소입니다. 이 요소가 없으면 오류에 대한 세부 요소가 정의되지 않습니다.

이러한 속성은 다음 코드 예제와 같이 SOAP 1.2 오류에 바인딩됩니다.

<S:Envelope>
  <S:Header>
    <wsa:Action>https://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
    <!-- Headers excluded for clarity -->
  </S:Header>
  <S:Body>
    <S:Fault>
      <S:Code>
        <S:Value>[Code]</S:Value>
        <S:Subcode>
          <S:Value>[Subcode]</S:Value>
        </S:Subcode>
      </S:Code>
      <S:Reason>
        <S:Text xml:lang="en">[Reason]</S:Text>
      </S:Reason>
      <S:Detail>[Detail]</S:Detail>
    </S:Fault>
  </S:Body>
</S:Envelope>

다음 코드 예제에서는 샘플 SOAP 오류를 보여줍니다.

<soap:Envelope xmlns:soap="https://www.w3.org/2003/05/soapelope"
    xmlns:xml="https://www.w3.org/XML/1998/namespace"
    xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:nprt="https://schemas.microsoft.com/windows/2006/01/wdp/scan">
  <soap:Header>
    <wsa:Action>https://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
    <!-- Headers excluded for brevity -->
  </soap:Header>
  <soap:Body>
    <soap:Fault>
      <soap:Code>
        <soap:Value>env:Sender</soap:Value>
        <soap:Subcode>
          <soap:Value>wscn:OperationFailed</soap:Value>
        </soap:Subcode>
      </soap:Code>
      <soap:Reason>
        <soap:Text xml:lang="en">Service cannot perform the requested operation</soap:Text>
      </soap:Reason>
    </soap:Fault>
  </soap:Body>
</soap:Envelope>