cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1462535 - /cxf/trunk/services/ws-discovery/ws-discovery-api/src/main/java/org/apache/cxf/ws/discovery/internal/WSDiscoveryServiceImpl.java
Date Fri, 29 Mar 2013 17:02:37 GMT
Author: dkulp
Date: Fri Mar 29 17:02:37 2013
New Revision: 1462535

URL: http://svn.apache.org/r1462535
Log:
[CXF-4898] Allow specify extra "types" for WS-Discovery registration

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=1462535&r1=1462534&r2=1462535&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 Mar 29 17:02:37 2013
@@ -125,10 +125,28 @@ public class WSDiscoveryServiceImpl impl
         ht.setScopes(new ScopesType());
         ht.setMetadataVersion(1);
         
-        QName sn = ServiceModelUtil.getServiceQName(server.getEndpoint().getEndpointInfo());
-        ht.getTypes().add(sn);
+
+        Object o = server.getEndpoint().get("ws-discovery-types");
+        if (o instanceof QName) {
+            ht.getTypes().add((QName)o);
+        } else if (o instanceof List) {
+            for (Object o2: (List<?>)o) {
+                if (o2 instanceof QName) {
+                    ht.getTypes().add((QName)o2);
+                } else if (o2 instanceof String) {
+                    ht.getTypes().add(QName.valueOf((String)o2));
+                }
+            }
+        } else if (o instanceof String) {
+            ht.getTypes().add(QName.valueOf((String)o));
+        } 
+        if (ht.getTypes().isEmpty()) {
+            QName sn = ServiceModelUtil.getServiceQName(server.getEndpoint().getEndpointInfo());
+            ht.getTypes().add(sn);
+        }
+
         
-        Object o = server.getEndpoint().get("ws-discovery-scopes");
+        o = server.getEndpoint().get("ws-discovery-scopes");
         if (o != null) {
             setScopes(ht, o);
         }



Mime
View raw message