servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r387168 - in /incubator/servicemix/trunk/servicemix-jsr181/src: main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
Date Mon, 20 Mar 2006 09:07:02 GMT
Author: gnodet
Date: Mon Mar 20 01:07:00 2006
New Revision: 387168

URL: http://svn.apache.org/viewcvs?rev=387168&view=rev
Log:
SM-354: servicemix-jsr181 should be able to override generated WSDL to use the given endpoint
name instead of logging a warning

Modified:
    incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
    incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java?rev=387168&r1=387167&r2=387168&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
(original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181Endpoint.java
Mon Mar 20 01:07:00 2006
@@ -27,7 +27,6 @@
 import javax.jbi.component.ComponentContext;
 import javax.jbi.messaging.MessageExchange.Role;
 import javax.jbi.servicedesc.ServiceEndpoint;
-import javax.wsdl.Definition;
 import javax.wsdl.Port;
 import javax.wsdl.factory.WSDLFactory;
 import javax.xml.namespace.QName;
@@ -266,8 +265,8 @@
                     ") does not match the service name defined in the endpoint spec (" +
interfaceName + 
                     "). WSDL description may be unusable.");
         }
-        Definition d = WSDLFactory.newInstance().newWSDLReader().readWSDL(null, description);
-        javax.wsdl.Service service = d.getService(serviceName);
+        definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(null, description);
+        javax.wsdl.Service service = definition.getService(serviceName);
         if (service != null) {
             if (service.getPorts().values().size() == 1) {
                 Port port = (Port) service.getPorts().values().iterator().next();
@@ -276,9 +275,9 @@
                 if (endpoint == null) {
                     endpoint = endpointName;
                 } else if (!endpoint.equals(endpointName)) {
-                    logger.warn("The endpoint name defined in the wsdl (" + endpointName
+ 
-                            ") does not match the endpoint name defined in the endpoint spec
(" + endpoint + 
-                    "). WSDL description may be unusable.");
+                    // Override generated WSDL
+                    port.setName(endpoint);
+                    description = WSDLFactory.newInstance().newWSDLWriter().getDocument(definition);
                 }
             }
         }

Modified: incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
URL: http://svn.apache.org/viewcvs/incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java?rev=387168&r1=387167&r2=387168&view=diff
==============================================================================
--- incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
(original)
+++ incubator/servicemix/trunk/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181OverrideTest.java
Mon Mar 20 01:07:00 2006
@@ -39,6 +39,7 @@
         container.setNamingContext(new InitialContext());
         container.setEmbedded(true);
         container.init();
+        container.start();
     }
     
     protected void tearDown() throws Exception {



Mime
View raw message