Author: midon
Date: Thu Apr  2 00:40:41 2009
New Revision: 761131

URL: http://svn.apache.org/viewvc?rev=761131&view=rev
Log:
ODEAxisService makes some assumptions on the service name, so let him pick the 
name

Modified:
    
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
    
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java

Modified: 
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java?rev=761131&r1=761130&r2=761131&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/ODEServer.java
 Thu Apr  2 00:40:41 2009
@@ -346,17 +346,11 @@
     }
 
     public ODEService createService(ProcessConf pconf, QName serviceName, 
String portName) throws AxisFault {
-        // Since multiple processes may provide services at the same (JMS) 
endpoint, qualify
-        // the (JMS) endpoint-specific NCName with a process-relative URI, if 
necessary.
-        QName uniqueServiceName = new QName(
-                ODEAxisService.extractServiceName(pconf, serviceName, 
portName));
-
-        destroyService(uniqueServiceName, portName);
-
-        AxisService axisService = ODEAxisService.createService(
-                _axisConfig, pconf, serviceName, portName, 
uniqueServiceName.getLocalPart());
+        AxisService axisService = ODEAxisService.createService(_axisConfig, 
pconf, serviceName, portName);
         ODEService odeService = new ODEService(axisService, pconf, 
serviceName, portName, _server, _txMgr);
 
+        QName uniqueServiceName = new QName(axisService.getName());
+        destroyService(uniqueServiceName, portName);
         _services.put(uniqueServiceName, portName, odeService);
 
         // Setting our new service on the ODE receiver

Modified: 
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
URL: 
http://svn.apache.org/viewvc/ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java?rev=761131&r1=761130&r2=761131&view=diff
==============================================================================
--- 
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
 (original)
+++ 
ode/branches/APACHE_ODE_1.X/axis2/src/main/java/org/apache/ode/axis2/hooks/ODEAxisService.java
 Thu Apr  2 00:40:41 2009
@@ -61,8 +61,7 @@
 
     private static final Log LOG = LogFactory.getLog(ODEAxisService.class);
 
-    public static AxisService createService(AxisConfiguration axisConfig, 
ProcessConf pconf, QName wsdlServiceName,
-                                            String portName, String 
axisServiceName) throws AxisFault {
+    public static AxisService createService(AxisConfiguration axisConfig, 
ProcessConf pconf, QName wsdlServiceName, String portName) throws AxisFault {
         Definition wsdlDefinition = 
pconf.getDefinitionForService(wsdlServiceName);
 
         if (LOG.isDebugEnabled()) {
@@ -80,6 +79,8 @@
             serviceBuilder.setCustomWSLD4JResolver(new 
Axis2WSDLLocator(baseUri));
             serviceBuilder.setServerSide(true);
 
+            String axisServiceName = ODEAxisService.extractServiceName(pconf, 
wsdlServiceName, portName);
+
             AxisService axisService = serviceBuilder.populateService();
             axisService.setParent(axisConfig);
             axisService.setName(axisServiceName);
@@ -138,22 +139,22 @@
 
     /**
      * Extract the JMS destination name that is embedded in the Axis service 
name.
-     * @param serviceName the name of the axis service
+     * @param axisServiceName the name of the axis service
      * @return the corresponding JMS destination name
      */
-    private static String extractJMSDestinationName(String serviceName, String 
baseUri) {
+    private static String extractJMSDestinationName(String axisServiceName, 
String baseUri) {
         String destinationPrefix = "dynamicQueues/";
-        int index = serviceName.indexOf(destinationPrefix);
+        int index = axisServiceName.indexOf(destinationPrefix);
         if (index == -1) {
             destinationPrefix = "dynamicTopics/";
-            index = serviceName.indexOf(destinationPrefix);
+            index = axisServiceName.indexOf(destinationPrefix);
         }
         if (index == -1) {
             destinationPrefix = baseUri + "/";
-            index = serviceName.indexOf(destinationPrefix);
-            return (index != -1) ? 
serviceName.substring(destinationPrefix.length()) : serviceName;
+            index = axisServiceName.indexOf(destinationPrefix);
+            return (index != -1) ? 
axisServiceName.substring(destinationPrefix.length()) : axisServiceName;
         } else {
-            return serviceName.substring(index);
+            return axisServiceName.substring(index);
         }
     }
 
@@ -205,7 +206,7 @@
         return url.startsWith("jms:");
     }
     
-    public static String extractServiceName(ProcessConf pconf, QName 
wsdlServiceName, String portName)
+    private static String extractServiceName(ProcessConf pconf, QName 
wsdlServiceName, String portName)
             throws AxisFault {
         String endpointUri = extractEndpointUri(pconf, wsdlServiceName, 
portName);
         String derivedUri = deriveBaseServiceUri(pconf);
@@ -241,6 +242,8 @@
                     service = service.substring(0, queryIndex);
                 }
                 // Qualify shared JMS names with unique baseUri
+                // Since multiple processes may provide services at the same 
(JMS) endpoint, qualify
+                // the (JMS) endpoint-specific NCName with a process-relative 
URI, if necessary.
                 if (path.startsWith("jms:/")) {
                     boolean slashPresent = baseUri.endsWith("/") || 
service.startsWith("/");
                     // service = baseUri + (slashPresent ? "" : "/") + 
service; // allow successive slashes ("//") in the URI


Reply via email to