geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1102685 - /geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Date Fri, 13 May 2011 11:59:46 GMT
Author: xuhaihong
Date: Fri May 13 11:59:45 2011
New Revision: 1102685

URL: http://svn.apache.org/viewvc?rev=1102685&view=rev
Log:
Use the endpoint class name to find the correct EndpointDescription

Modified:
    geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java

Modified: geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?rev=1102685&r1=1102684&r2=1102685&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/trunk/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Fri May 13 11:59:45 2011
@@ -196,7 +196,7 @@ public class AxisServiceGenerator
             dbc.setIsMTOMEnabled(portInfo.isMTOMEnabled().booleanValue());
         }
 
-        AxisService service = getService(dbcMap);
+        AxisService service = getService(dbcMap, endpointClassName);
 
         service.setName(serviceQName.getLocalPart());
         service.setEndpointName(portQName.getLocalPart());
@@ -266,21 +266,24 @@ public class AxisServiceGenerator
         }
     }
 
-    private AxisService getService(HashMap<String, DescriptionBuilderComposite> dbcMap)
{
-        return getEndpointDescription(dbcMap).getAxisService();
+    private AxisService getService(HashMap<String, DescriptionBuilderComposite> dbcMap,
String endpointClassName) {
+        return getEndpointDescription(dbcMap, endpointClassName).getAxisService();
     }
 
-    private EndpointDescription getEndpointDescription(HashMap<String, DescriptionBuilderComposite>
dbcMap) {
+    private EndpointDescription getEndpointDescription(HashMap<String, DescriptionBuilderComposite>
dbcMap, String endpointClassName) {
         List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap,
this.configurationContext);
         if (serviceDescList == null || serviceDescList.isEmpty()) {
-            throw new RuntimeException("No service");
-        }
-        ServiceDescription serviceDescription = serviceDescList.get(0);
-        EndpointDescription[] edArray = serviceDescription.getEndpointDescriptions();
-        if (edArray == null || edArray.length == 0) {
-            throw new RuntimeException("No endpoint");
-        }
-        return edArray[0];
+            throw new RuntimeException("No service found for SEI class " + endpointClassName);
+        }        
+        for(ServiceDescription serviceDescription : serviceDescList) {
+            for(EndpointDescription endpointDescription : serviceDescription.getEndpointDescriptions())
{
+                DescriptionBuilderComposite dbc = endpointDescription.getDescriptionBuilderComposite();
+                if(endpointClassName.equals(dbc.getClassName())) {
+                    return endpointDescription;
+                }
+            }
+        }  
+        throw new RuntimeException("No endpoint found for SEI class " + endpointClassName);
       
     }
 
     private static class WSDLGeneratorImpl implements WsdlGenerator {



Mime
View raw message