geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r157665 - in geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder: AxisBuilder.java AxisServiceBuilder.java HeavyweightOperationDescBuilder.java LightweightOperationDescBuilder.java
Date Wed, 16 Mar 2005 04:26:24 GMT
Author: dblevins
Date: Tue Mar 15 20:26:23 2005
New Revision: 157665

URL: http://svn.apache.org/viewcvs?view=rev&rev=157665
Log:
OperationBuilders set the method instance on the OperationDesc.
Note this will cause serialization failures at deploy time till AXIS-1878 is applied:
http://issues.apache.org/jira/secure/ManageAttachments.jspa?id=30933


Modified:
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java?view=diff&r1=157664&r2=157665
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisBuilder.java
Tue Mar 15 20:26:23 2005
@@ -280,7 +280,7 @@
             String operationName = operation.getName();
             BindingOperation bindingOperation = binding.getBindingOperation(operationName,
operation.getInput().getName(), operation.getOutput() == null ? null : operation.getOutput().getName());
             ServiceEndpointMethodMappingType methodMapping = WSDescriptorParser.getMethodMappingForOperation(operationName,
methodMappings);
-            OperationInfo operationInfo = buildOperationInfoHeavyweight(methodMapping, bindingOperation,
portStyle, soapVersion, exceptionMap, complexTypeMap, mapping, classLoader);
+            OperationInfo operationInfo = buildOperationInfoHeavyweight(methodMapping, bindingOperation,
portStyle, soapVersion, exceptionMap, complexTypeMap, mapping, classLoader, enhancedServiceEndpointClass);
             operationInfos[i++] = operationInfo;
         }
         JavaXmlTypeMappingType[] javaXmlTypeMappings = mapping.getJavaXmlTypeMappingArray();
@@ -474,8 +474,8 @@
         return operationDescBuilder.buildOperationInfo(soapVersion);
     }
 
-    public OperationInfo buildOperationInfoHeavyweight(ServiceEndpointMethodMappingType methodMapping,
BindingOperation bindingOperation, Style defaultStyle, SOAPConstants soapVersion, Map exceptionMap,
Map complexTypeMap, JavaWsdlMappingType mapping, ClassLoader classLoader) throws DeploymentException
{
-        HeavyweightOperationDescBuilder operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
mapping, methodMapping, defaultStyle, exceptionMap, complexTypeMap, classLoader);
+    public OperationInfo buildOperationInfoHeavyweight(ServiceEndpointMethodMappingType methodMapping,
BindingOperation bindingOperation, Style defaultStyle, SOAPConstants soapVersion, Map exceptionMap,
Map complexTypeMap, JavaWsdlMappingType mapping, ClassLoader classLoader, Class serviceEndpointInterface)
throws DeploymentException {
+        HeavyweightOperationDescBuilder operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
mapping, methodMapping, defaultStyle, exceptionMap, complexTypeMap, classLoader, serviceEndpointInterface);
         return operationDescBuilder.buildOperationInfo(soapVersion);
     }
 

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java?view=diff&r1=157664&r2=157665
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/AxisServiceBuilder.java
Tue Mar 15 20:26:23 2005
@@ -261,7 +261,7 @@
                 String operationName = bindingOperation.getOperation().getName();
                 ServiceEndpointMethodMappingType[] methodMappings = portInfo.getServiceEndpointInterfaceMapping().getServiceEndpointMethodMappingArray();
                 ServiceEndpointMethodMappingType methodMapping = WSDescriptorParser.getMethodMappingForOperation(operationName,
methodMappings);
-                operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
portInfo.getJavaWsdlMapping(), methodMapping, Style.RPC, exceptionMap, complexTypeMap, classLoader);
+                operationDescBuilder = new HeavyweightOperationDescBuilder(bindingOperation,
portInfo.getJavaWsdlMapping(), methodMapping, Style.RPC, exceptionMap, complexTypeMap, classLoader,
serviceEndpointInterface);
             }
 
             serviceDesc.addOperationDesc(operationDescBuilder.buildOperationDesc());

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java?view=diff&r1=157664&r2=157665
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/HeavyweightOperationDescBuilder.java
Tue Mar 15 20:26:23 2005
@@ -17,6 +17,7 @@
 package org.apache.geronimo.axis.builder;
 
 import java.lang.String;
+import java.lang.reflect.Method;
 import java.util.*;
 import javax.wsdl.*;
 import javax.wsdl.extensions.soap.SOAPBody;
@@ -53,8 +54,9 @@
      */
     private final Set inParamNames = new HashSet();
     private final Set outParamNames = new HashSet();
+    private final Class serviceEndpointInterface;
 
-    public HeavyweightOperationDescBuilder(BindingOperation bindingOperation, JavaWsdlMappingType
mapping, ServiceEndpointMethodMappingType methodMapping, Style defaultStyle, Map exceptionMap,
Map complexTypeMap, ClassLoader classLoader) throws DeploymentException {
+    public HeavyweightOperationDescBuilder(BindingOperation bindingOperation, JavaWsdlMappingType
mapping, ServiceEndpointMethodMappingType methodMapping, Style defaultStyle, Map exceptionMap,
Map complexTypeMap, ClassLoader classLoader, Class serviceEndpointInterface) throws DeploymentException
{
         super(bindingOperation);
         this.mapping = mapping;
         this.methodMapping = methodMapping;
@@ -62,7 +64,7 @@
         this.exceptionMap = exceptionMap;
         this.complexTypeMap = complexTypeMap;
         this.classLoader = classLoader;
-
+        this.serviceEndpointInterface = serviceEndpointInterface;
         BindingInput bindingInput = bindingOperation.getBindingInput();
         this.soapBody = (SOAPBody) WSDescriptorParser.getExtensibilityElement(SOAPBody.class,
bindingInput.getExtensibilityElements());
     }
@@ -105,7 +107,6 @@
         Use use = Use.getUse(soapBody.getUse());
         operationDesc.setUse(use);
 
-
         boolean isWrappedElement = methodMapping.isSetWrappedElement();
 
         MethodParamPartsMappingType[] paramMappings = methodMapping.getMethodParamPartsMappingArray();
@@ -131,14 +132,34 @@
             throw new DeploymentException("Not all input message parts were mapped for operation
name" + operationName);
         }
 
-        //check that all the parameters are there
+        Class[] paramTypes = new Class[parameterDescriptions.length];
         for (int i = 0; i < parameterDescriptions.length; i++) {
             ParameterDesc parameterDescription = parameterDescriptions[i];
             if (parameterDescription == null) {
                 throw new DeploymentException("There is no mapping for parameter number "
+ i + " for operation " + operationName);
             }
             operationDesc.addParameter(parameterDescription);
+            paramTypes[i] = parameterDescription.getJavaType();
         }
+
+        String methodName = methodMapping.getJavaMethodName().getStringValue().trim();
+        Method method = null;
+        try {
+            method = serviceEndpointInterface.getMethod(methodName, paramTypes);
+        } catch (NoSuchMethodException e) {
+            String args = "(";
+            for (int i = 0; i < paramTypes.length; i++) {
+                args += paramTypes[i].getName();
+                if (i < paramTypes.length-1){
+                    args += ",";
+                }
+            }
+            args += ")";
+            
+            throw new DeploymentException("Mapping references non-existent method in service-endpoint:
" + methodName+ args);
+        }
+
+        operationDesc.setMethod(method);
 
         // MAP RETURN TYPE
         if (methodMapping.isSetWsdlReturnValueMapping()) {

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java?view=diff&r1=157664&r2=157665
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/LightweightOperationDescBuilder.java
Tue Mar 15 20:26:23 2005
@@ -74,6 +74,8 @@
 
         built = true;
 
+        operationDesc.setMethod(method);
+        
         //section 7.3.2, we don't have to look at parameter ordering.
         //unless it turns out we have to validate it.
 //        List order = operation.getParameterOrdering();



Mime
View raw message