WinHTTP 로깅을 사용하여 트래픽 가져오기 확인

일반 호스트 및 클라이언트가 성공하지만 실제 호스트 및 클라이언트가 여전히 실패하는 경우 메타데이터 요청이 시작되지 않을 수 있습니다. WinHTTP 로깅을 사용하여 아웃바운드 메시지가 생성되고 올바르게 전송되고 있는지 확인할 수 있습니다.

WSDAPI 기반 클라이언트 애플리케이션은 WinHTTP 를 사용하여 디바이스에 연결합니다. WSDAPI 기반 디바이스 호스트는 WinHTTP를 사용하지 않습니다. 또한 일부 타사 프록시는 WinHTTP를 사용하지 않습니다. WinHTTP를 사용하지 않는 호스트 또는 프록시 문제를 해결하는 경우 이 진단 절차를 건너뛰고 HTTP 메타데이터 Exchange에 대한 네트워크 추적 검사의 절차에 따라 문제 해결을 계속합니다.

WinHTTP 로깅은 모든 TCP 수준 트래픽을 표시하지 않습니다. HTTP 트래픽 외에 트래픽 이 관심 있는 경우 HTTP 메타데이터 Exchange에 대한 네트워크 추적 검사 로 건너뜁니다.

WinHTTP 로깅을 사용하여 트래픽 가져오기를 확인하려면

  1. WinHTTP 로그를 캡처합니다.
  2. 메모장이나 다른 텍스트 편집기를 시작합니다. 텍스트 편집기를 관리자 권한으로 실행해야 합니다.
  3. WinHTTP 로그 파일을 엽니다.
  4. 필요한 HTTP 요청 및 메타데이터 메시지가 전송되었는지 확인합니다.

호스트에 대한 Get 메시지가 WinHTTP 로그에 있으면 메타데이터 요청이 WinHTTP로 성공적으로 전송됩니다. HTTP 메타데이터 Exchange에 대한 네트워크 추적 검사의 절차에 따라 문제 해결을 계속합니다.

WinHTTP 로그에서 호스트에 대한 Get 메시지를 찾을 수 없는 경우 메타데이터 요청이 시작되지 않습니다. 호스트가 잘못된 XAddrs를 게시할 때 발생할 수 있습니다. 호스트의 XAddr가 XAddr 유효성 검사 규칙을 준수하는지 확인합니다.

필요한 HTTP 요청 및 메타데이터 메시지가 전송되었는지 확인

성공적인 메타데이터 교환을 위해 다음 이벤트가 발생해야 합니다.

  • WSDAPI 클라이언트는 아웃바운드 HTTP 요청을 생성합니다. 이 요청은 WSDAPI 호스트로 전송됩니다.
  • 클라이언트는 호스트에 Get 메시지를 보냅니다.

이러한 이벤트는 WinHTTP 로그에 캡처됩니다.

다음 WinHTTP 로그 파일 코드 조각은 WSDAPI 클라이언트에서 생성된 아웃바운드 HTTP 요청을 보여 줍니다.

16:51:47.893 ::*0000004* :: WinHttpSendRequest(0x36aae0, "", 0, 0x0, 0, 658, 0)
16:51:47.893 ::*0000004* :: WinHttpSendRequest() returning TRUE
16:51:47.897 ::*0000004* :: sending data:
16:51:47.897 ::*0000004* :: 226 (0xe2) bytes
16:51:47.897 ::*0000004* :: <<<<-------- HTTP stream follows below ----------------------------------------------->>>>
16:51:47.897 ::*0000004* :: POST /dbe17c74-3b21-4f52-addc-b84b444f73a0 HTTP/1.1
16:51:47.897 ::*0000004* :: Content-Type: application/soap+xml
16:51:47.897 ::*0000004* :: User-Agent: WSDAPI
16:51:47.897 ::*0000004* :: Host: 192.168.0.1:5357
16:51:47.897 ::*0000004* :: Content-Length: 658
16:51:47.897 ::*0000004* :: Connection: Keep-Alive
16:51:47.897 ::*0000004* :: Cache-Control: no-cache
16:51:47.897 ::*0000004* :: Pragma: no-cache
16:51:47.897 ::*0000004* :: 
16:51:47.897 ::*0000004* :: 
16:51:47.897 ::*0000004* :: <<<<-------- End ----------------------------------------------->>>>

다음 WinHTTP 로그 파일 코드 조각에는 Get 메시지가 표시됩니다. 이 메시지는 HTTP 요청을 즉시 따라야 합니다.

16:51:47.898 ::*0000004* :: WinHttpWriteData(0x36aae0, 0x11aa7c4, 658, 0x0)
16:51:47.899 ::*0000004* :: sending data:
16:51:47.899 ::*0000004* :: 658 (0x292) bytes
16:51:47.899 ::*0000004* :: <<<<-------- HTTP stream follows below ----------------------------------------------->>>>
16:51:47.899 ::*0000004* :: <?xml version="1.0" encoding="utf-8" ?>
16:51:47.899 ::*0000004* :: <soap:Envelope xmlns:soap="https://www.w3.org/2003/05/soap-envelope" xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"><soap:Header><wsa:To>urn:uuid:dbe17c74-3b21-4f52-addc-b84b444f73a0</wsa:To><wsa:Action>https://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action><wsa:MessageID>urn:uuid:8506ac50-3646-4621-9680-86f484d87909</wsa:MessageID><wsa:ReplyTo><wsa:Address>https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:Address></wsa:ReplyTo><wsa:From><wsa:Address>urn:uuid:b32467b5-e7ee-4ae3-8a8e-f5aa417c23b6</wsa:Address></wsa:From></soap:Header><soap:Body></soap:Body></soap:Envelope>
16:51:47.899 ::*0000004* :: <<<<-------- End ----------------------------------------------->>>>
16:51:47.899 ::*0000004* :: WinHttpWriteData() returning TRUE

Action 요소(<wsa:Action>https://schemas.xmlsoap.org/ws/2004/09/transfer/Get</wsa:Action>)는 메시지를 Get 메시지로 식별합니다. To 요소(예<wsa:To>urn:uuid:dbe17c74-3b21-4f52-addc-b84b444f73a0</wsa:To>: )의 값이 원래 UDP WS-Discovery 메시지에서 호스트가 보급한 디바이스 ID와 일치하는지 확인합니다. 호스트에서 보급한 디바이스 ID는 WSD 디버그 호스트를 사용하여 확인할 수 있습니다. 자세한 내용은 UDP WS-Discovery에 일반 호스트 및 클라이언트 사용을 참조하세요.

또한 메타데이터 요청에 대한 호스트의 응답은 클라이언트의 WinHTTP 로그에서 찾을 수 있습니다. 호스트는 클라이언트의 Get 메시지에 대한 응답으로 GetResponse 메시지를 생성합니다.

다음 WinHTTP 로그 파일 코드 조각은 WSDAPI 클라이언트에서 받은 인바운드 GetResponse 메시지를 보여 줍니다.

16:51:47.899 ::*0000004* :: WinHttpReceiveResponse(0x36aae0, 0x0)
16:51:47.899 ::*0000004* :: WinHttpReceiveResponse() returning TRUE
16:51:47.899 ::*Session* :: DllMain(0x73fc0000, DLL_THREAD_ATTACH, 0x0)
16:51:47.902 ::*0000004* :: received data:
16:51:47.902 ::*0000004* :: 1024 (0x400) bytes
16:51:47.902 ::*0000004* :: <<<<-------- HTTP stream follows below ----------------------------------------------->>>>
16:51:47.902 ::*0000004* :: HTTP/1.1 200 
16:51:47.902 ::*0000004* :: Content-Type: application/soap+xml
16:51:47.902 ::*0000004* :: Server: Microsoft-HTTPAPI/2.0
16:51:47.902 ::*0000004* :: Date: Fri, 15 Jun 2007 23:51:47 GMT
16:51:47.905 ::*0000004* :: Content-Length: 2228
16:51:47.905 ::*0000004* :: 
16:51:47.905 ::*0000004* :: <?xml version="1.0" encoding="utf-8" ?>
16:51:47.905 ::*0000004* :: <soap:Envelope xmlns:soap="https://www.w3.org/2003/05/soap-envelope" xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsx="https://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsdp="https://schemas.xmlsoap.org/ws/2006/02/devprof" xmlns:un0="http://schemas.microsoft.com/windows/pnpx/2005/10" xmlns:pub="http://schemas.microsoft.com/windows/pub/2005/07"><soap:Header><wsa:To>https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To><wsa:Action>https://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse</wsa:Action><wsa:MessageID>urn:uuid:2884cbcc-2848-4c35-9327-5ab5451a8729</wsa:MessageID><wsa:RelatesTo>urn:uuid:8506ac50-3646-4621-9680-86f484d87909</wsa:RelatesTo></soap:Header><soap:Body><wsx:Metadata><wsx:MetadataSection Dialect="https://schemas.xmlsoap.org/ws/2006/02/devprof/ThisDevice"><wsdp:ThisDevice><wsd
16:51:47.905 ::*0000004* :: <<<<-------- End ----------------------------------------------->>>>

Action 요소(<wsa:Action>https://schemas.xmlsoap.org/ws/2004/09/transfer/GetResponse</wsa:Action>)는 메시지를 GetResponse 메시지로 식별합니다. GetResponse 메시지의 RelatesTo 요소 값이 Get 메시지의 MessageID 요소 값과 일치하는지 확인합니다. 이 예제에서 RelatesTo 요소()의 값은 Get 메시지(<wsa:RelatesTo>urn:uuid:8506ac50-3646-4621-9680-86f484d87909</wsa:RelatesTo>)의 MessageID 요소 값과<wsa:MessageID>urn:uuid:8506ac50-3646-4621-9680-86f484d87909</wsa:MessageID> 일치합니다.

WinHTTP

WinHTTP 로그 캡처

WSDAPI 진단 절차

WSDAPI 문제 해결을 사용한 시작