geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r545413 - /geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Date Fri, 08 Jun 2007 05:14:00 GMT
Author: gawor
Date: Thu Jun  7 22:13:59 2007
New Revision: 545413

URL: http://svn.apache.org/viewvc?view=rev&rev=545413
Log:
initalize things in the same way if built from class or wsdl

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

Modified: geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java?view=diff&rev=545413&r1=545412&r2=545413
==============================================================================
--- geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
(original)
+++ geronimo/server/trunk/modules/geronimo-axis2/src/main/java/org/apache/geronimo/axis2/AxisServiceGenerator.java
Thu Jun  7 22:13:59 2007
@@ -74,9 +74,7 @@
  */
 public class AxisServiceGenerator {
     private static final Log log = LogFactory.getLog(AxisServiceGenerator.class);
-    
-    private static String WSDL_ENCODING = "UTF-8";
-    
+        
     private MessageReceiver messageReceiver;
     
     public AxisServiceGenerator(){
@@ -88,13 +86,11 @@
     }
    
     public AxisService getServiceFromClass(Class endpointClass) throws Exception {
-        AxisService service = DescriptionFactory.createAxisService(endpointClass);
-        
-        for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext()
;){
-            AxisOperation operation = opIterator.next();
-            operation.setMessageReceiver(this.messageReceiver);
-        }
-        
+        ServiceDescription serviceDescription = 
+            DescriptionFactory.createServiceDescription(endpointClass);        
+        EndpointDescription[] edArray = serviceDescription.getEndpointDescriptions();
+        AxisService service = edArray[0].getAxisService();
+                
         if (service.getNameSpacesMap() == null) {
             NamespaceMap map = new NamespaceMap();
             map.put(Java2WSDLConstants.AXIS2_NAMESPACE_PREFIX,
@@ -104,6 +100,15 @@
             service.setNameSpacesMap(map);
         }
         
+        for(Iterator<AxisOperation> opIterator = service.getOperations() ; opIterator.hasNext()
;){
+            AxisOperation operation = opIterator.next();
+            operation.setMessageReceiver(this.messageReceiver);
+        }
+        
+        Parameter serviceDescriptionParam = 
+            new Parameter(EndpointDescription.AXIS_SERVICE_PARAMETER, edArray[0]);
+        service.addParameter(serviceDescriptionParam);
+        
         return service;
     }
     
@@ -219,9 +224,11 @@
         
         List<ServiceDescription> serviceDescList = DescriptionFactory.createServiceDescriptionFromDBCMap(dbcMap);
         if ((serviceDescList != null) && (serviceDescList.size() > 0)) {
-            ServiceDescription sd = serviceDescList.get(0);
-            Parameter serviceDescription = new Parameter(EndpointDescription.AXIS_SERVICE_PARAMETER,
sd.getEndpointDescriptions()[0]);
-            service.addParameter(serviceDescription);
+            ServiceDescription serviceDescription = serviceDescList.get(0);
+            EndpointDescription[] edArray = serviceDescription.getEndpointDescriptions();
+            Parameter serviceDescriptionParam = 
+                new Parameter(EndpointDescription.AXIS_SERVICE_PARAMETER, edArray[0]);
+            service.addParameter(serviceDescriptionParam);
         } else {
             log.debug("No ServiceDescriptions found.");
         }



Mime
View raw message