ProbeMatches 消息

ProbeMatches 消息是服务为响应客户端的 探测 消息而发送的WS-Discovery消息。 有关 ProbeMatches 消息的详细信息,请参阅 WS-Discovery 规范的第 5.3 节。

ProbeMatches 消息由 UDP 单播发送到从中发送客户端 探测 消息的端口。 ProbeMatches 必须在探测消息的 4 秒内发送;否则,Windows 防火墙可能会丢弃数据包。

如果 ProbeMatches 消息中不包含 XAddrs,则客户端可以通过 UDP 多播将 Resolve 消息发送到端口 3702。 仅当 HTTP 消息 ((如 获取 元数据交换请求或服务消息) )时,客户端才会发送 Resolve 消息。

发送 探测 消息的任何 DPWS 应用程序都将接收 ProbeMatches 消息。

注意

本主题演示 WSDAPI 客户端和主机生成的 DPWS 消息示例。 WSDAPI 将分析和接受不符合此示例的其他符合 DPWS 的消息。 不要使用此示例来验证 DPWS 互操作性;请改用 WSDAPI 基本互操作性工具 (WSDBIT)

 

以下 SOAP 消息显示了一个示例 ProbeMatches 消息。

<?xml version="1.0" encoding="utf-8" ?>
<soap:Envelope
    xmlns:soap="https://www.w3.org/2003/05/soap-envelope"
    xmlns:wsa="https://schemas.xmlsoap.org/ws/2004/08/addressing"
    xmlns:wsd="https://schemas.xmlsoap.org/ws/2005/04/discovery"
    xmlns:wsdp="https://schemas.xmlsoap.org/ws/2006/02/devprof">
<soap:Header>
    <wsa:To>
        https://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
    </wsa:To>
    <wsa:Action>
        https://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches
    </wsa:Action>
    <wsa:MessageID>
        urn:uuid:967d0036-fe69-40ad-8191-dd1fc8ef64ab
    </wsa:MessageID>
    <wsa:RelatesTo>
        urn:uuid:29cf10da-5c41-4d55-b184-5ee15e38ce23
    </wsa:RelatesTo>
    <wsd:AppSequence InstanceId="1"
        SequenceId="urn:uuid:369a7d7b-5f87-48a4-aa9a-189edf2a8772"
        MessageNumber="9">
    </wsd:AppSequence>
</soap:Header>
<soap:Body>
    <wsd:ProbeMatches>
        <wsd:ProbeMatch>
            <wsa:EndpointReference>
                <wsa:Address>
                    urn:uuid:37f86d35-e6ac-4241-964f-1d9ae46fb366
                </wsa:Address>
            </wsa:EndpointReference>
            <wsd:Types>wsdp:Device</wsd:Types>
            <wsd:XAddrs>
                https://192.168.0.2:5357/37f86d35-e6ac-4241-964f-1d9ae46fb366
            </wsd:XAddrs>
            <wsd:MetadataVersion>2</wsd:MetadataVersion>
        </wsd:ProbeMatch>
    </wsd:ProbeMatches>
</soap:Body>
</soap:Envelope>

ProbeMatches 消息具有以下焦点。

焦点 XML 说明
ProbeMatches
<wsa:Action>
    https://schemas.xmlsoap.org/ws/2005/04/discovery/ProbeMatches
</wsa:Action>
ProbeMatches SOAP 操作将消息标识为 ProbeMatches 消息。
RelatesTo
<wsa:RelatesTo>
    urn:uuid:29cf10da-5c41-4d55-b184-5ee15e38ce23
</wsa:RelatesTo>
服务要响应的消息的标识符。 此标头与 探测 消息中的 MessageId 匹配。
AppSequence
<wsd:AppSequence InstanceId="1"
    SequenceId="urn:uuid:369a7d7b-5f87-48a4-aa9a-189edf2a8772"
    MessageNumber="9">
</wsd:AppSequence>
包含应用程序排序信息,这有助于维护消息的序列,即使消息是无序接收的。 AppSequence 已按照 AppSequence 验证规则中所述进行验证。
地址
<wsa:Address>
    urn:uuid:37f86d35-e6ac-4241-964f-1d9ae46fb366
</wsa:Address>
包含终结点地址。 此寻址可能在 Resolve 消息中引用。
XAddrs
<wsd:XAddrs>
    https://192.168.0.2:5357/37f86d35-e6ac-4241-964f-1d9ae46fb366
</wsd:XAddrs>
XAddrs 是可用于客户端和服务之间通信的传输地址。 如 XAddr 验证规则中所述,对添加器进行验证。

 

发现和元数据交换消息

探测消息