Author: buildbot
Date: Fri Sep 28 19:47:25 2012
New Revision: 833308

Log:
Production update by buildbot for cxf

Modified:
    websites/production/cxf/content/cache/docs.pageCache
    websites/production/cxf/content/docs/ws-discovery.html

Modified: websites/production/cxf/content/cache/docs.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/cxf/content/docs/ws-discovery.html
==============================================================================
--- websites/production/cxf/content/docs/ws-discovery.html (original)
+++ websites/production/cxf/content/docs/ws-discovery.html Fri Sep 28 19:47:25 
2012
@@ -121,7 +121,39 @@ Apache CXF -- WS-Discovery
          <td height="100%">
            <!-- Content -->
            <div class="wiki-content">
-<div id="ConfluenceContent"><h1><a shape="rect" 
name="WS-Discovery-WSDiscovery"></a>WS-Discovery</h1></div>
+<div id="ConfluenceContent"><h1><a shape="rect" 
name="WS-Discovery-WSDiscovery"></a>WS-Discovery</h1>
+
+<p><a shape="rect" class="external-link" 
href="http://docs.oasis-open.org/ws-dd/discovery/1.1/os/wsdd-discovery-1.1-spec-os.html";
 rel="nofollow">WS-Discovery</a> is a protocol to enable dynamic discovery of 
services available on the local network.   By default, WS-Discovery uses a UDP 
based multicast transport to announce new services and probe for existing 
services.  However, it also supports a managed mode where a discovery proxy is 
used to reduce the amount of multicast traffic required.</p>
+
+
+<h3><a shape="rect" 
name="WS-Discovery-EnablingWSDiscoveryannouncementsforservices"></a>Enabling 
WS-Discovery announcements for services</h3>
+
+<p>To enable CXF to send "Hello" announcements when services and endpoint are 
started, the cxf-services-ws-discovery-service and 
cxf-services-ws-discovery-api jars need to be available on the classpath.   The 
cxf-services-ws-discovery-service jar will register a ServerLifecyleListener 
that will automatically publish the "Hello" messages.   It will also respond to 
any Probe requests that match the services it has published.</p>
+
+<p>By default, the WS-Discovery service will startup in ad-hoc mode.  However, 
if you set a Bus property of "org.apache.cxf.service.ws-discovery.address" to a 
URL address of a WS-Discovery Proxy, the service will change to managed mode 
and send the Hello/Bye notices directly to that proxy.  It will also not 
respond to Probes.</p>
+
+
+<h3><a shape="rect" 
name="WS-Discovery-UsingWSDiscoveryclienttoprobeforservices"></a>Using 
WS-Discovery client to probe for services</h3>
+
+<p>CXF also provides an API to probe the network or WS-Discovery proxy.   The 
org.apache.cxf.ws.discovery.WSDiscoveryClient class provides several methods 
for probing the network. </p>
+
+<div class="code panel" style="border-width: 1px;"><div class="codeContent 
panelContent">
+<pre class="code-java">
+<span class="code-comment">//Use WS-Discovery to find references to services 
that implement the Greeter portType
+</span>WSDiscoveryClient client = <span class="code-keyword">new</span> 
WSDiscoveryClient();
+   <span class="code-comment">// or: <span class="code-keyword">new</span> 
WSDiscoveryClient(<span class="code-quote">"soap.udp://proxyhost:3702"</span>);
+</span>List&lt;EndpointReference&gt; references = client.probe(<span 
class="code-keyword">new</span> QName(<span class="code-quote">"http:<span 
class="code-comment">//cxf.apache.org/hello_world/discovery"</span>, <span 
class="code-quote">"Greeter"</span>));
+</span>client.close();
+        
+GreeterService service = <span class="code-keyword">new</span> 
GreeterService();
+<span class="code-comment">//loop through all of them and have them greet me.
+</span><span class="code-keyword">for</span> (EndpointReference ref : 
references) {
+    Greeter g = service.getPort(ref, Greeter.class);
+    <span class="code-object">System</span>.out.println(g.greetMe(<span 
class="code-quote">"World"</span>));
+} 
+</pre>
+</div></div>
+</div>
            </div>
            <!-- Content -->
          </td>


Reply via email to