geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xuhaih...@apache.org
Subject svn commit: r1102583 - /geronimo/server/branches/2.2/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Date Fri, 13 May 2011 07:05:52 GMT
Author: xuhaihong
Date: Fri May 13 07:05:51 2011
New Revision: 1102583

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

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

Modified: geronimo/server/branches/2.2/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?rev=1102583&r1=1102582&r2=1102583&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/branches/2.2/plugins/axis2/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Fri May 13 07:05:51 2011
@@ -194,7 +194,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());
@@ -264,21 +264,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