4.1 Probe Message Example

A client performing stock trades needs to locate a Target Service of Type i:StatisticalAnalysis and requires that service in the next 5 seconds. Using an implementation of WS-Discovery, it multicasts the following Probe message, which contains the <MaxResults> and <Duration> elements, as defined in this document. The <MaxResults> and <Duration> elements contain the termination criteria that limit the number of responses to one and the duration to 5 seconds. This following Probe message is sent from a client that is implementing [WS-Discovery1.1].

Example 1: Probe message sent using [WS-Discovery1.1]

 (01) <s:Envelope
 (02)     xmlns:a="http://schemas.xmlsoap.org/ws/2005/08/addressing"
 (03)     xmlns:d="http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01"
 (04)     xmlns:i="http://statistics.example.org/2003/stats"
 (05)     xmlns:s="http://www.w3.org/2003/05/soap-envelope" >
 (06)   <s:Header>
 (07)     <a:Action>
 (08)       http://docs.oasis-open.org/ws-dd/ns/discovery/2009/01/Probe
 (09)     </a:Action>
 (10)     <a:MessageID>
 (11)       urn:uuid:3afd5e21-de48-4277-8119-f25ebdd9890a
 (12)     </a:MessageID>
 (13)     <a:To>urn:docs-oasis-open-org:ws-dd:discovery:2009:01</a:To>
 (14)   </s:Header>
 (15)   <s:Body>
 (16)     <d:Probe>
 (17)       <d:Types>i:StatisticalAnalysis</d:Types>
 (18)       <MaxResults xmlns="http://schemas.microsoft.com/ws/2008/06/discovery">1</MaxResults>
 (19)       <Duration xmlns="http://schemas.microsoft.com/ws/2008/06/discovery">PT5S</Duration>
 (20)     </d:Probe>
 (21)   </s:Body>
 (22) </s:Envelope>
 (23)

Lines 18 and 19 show the termination criterion inserted into the Probe message.

A Target Service host is aware of several Target Services that match the Type the client is looking for. However, it is limited to responding with a Probe Match containing information about only one Target Service. If it is able to respond within 5 seconds, it replies back to the client with a Probe Match message containing information about one such service.