cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1376995 - /cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Date Fri, 24 Aug 2012 17:18:40 GMT
Author: dkulp
Date: Fri Aug 24 17:18:39 2012
New Revision: 1376995

URL: http://svn.apache.org/viewvc?rev=1376995&view=rev
Log:
Use the endpointPublishURL and other properties to fill in the discovery details

Modified:
    cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java

Modified: cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java?rev=1376995&r1=1376994&r2=1376995&view=diff
==============================================================================
--- cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
(original)
+++ cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Fri Aug 24 17:18:39 2012
@@ -42,6 +42,7 @@ import javax.xml.ws.EndpointReference;
 import javax.xml.ws.Provider;
 import javax.xml.ws.WebServiceProvider;
 import javax.xml.ws.soap.Addressing;
+import javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder;
 
 import org.w3c.dom.Document;
 
@@ -99,20 +100,40 @@ public class WSDiscoveryServiceImpl impl
         ht.setScopes(new ScopesType());
         ht.setMetadataVersion(1);
         ht.getTypes().add(server.getEndpoint().getEndpointInfo().getInterface().getName());
-        Object o = server.getEndpoint().get("ws-discover.scopes");
+        Object o = server.getEndpoint().get("ws-discovery-scopes");
         if (o != null) {
             setScopes(ht, o);
         }
         setXAddrs(ht, server);
+        String uuid = (String)server.getEndpoint().get("ws-discovery-uuid");
+        if (uuid != null) {
+            //persistent uuid
+            W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
+            builder.address(uuid);
+            ht.setEndpointReference(builder.build());
+        }
         ht = client.register(ht);
         registered.add(ht);
         server.getEndpoint().put(HelloType.class.getName(), ht);
     }
 
     private void setXAddrs(HelloType ht, Server server) {
-        String s = server.getEndpoint().getEndpointInfo().getAddress();
-        //FIXME - servlet mode, need all the servlet information to create a full address
-        ht.getXAddrs().add(s);
+        String s = (String)server.getEndpoint().get("ws-discovery-published-url");
+        if (s == null) {
+            s = (String)server.getEndpoint().getEndpointInfo().getProperty("ws-discovery-published-url");
+        } 
+        if (s == null) {
+            s = (String)server.getEndpoint().get("publishedEndpointUrl");
+        }
+        if (s == null) {
+            s = (String)server.getEndpoint().getEndpointInfo().getProperty("publishedEndpointUrl");
+        }
+        if (s == null) {
+            s = server.getEndpoint().getEndpointInfo().getAddress();
+        }
+        if (s != null) {
+            ht.getXAddrs().add(s);
+        }
     }
 
     private void setScopes(HelloType ht, Object o) {



Mime
View raw message