geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r165072 - in /geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder: HeavyweightOperationDescBuilder.java LightweightOperationDescBuilder.java OperationDescBuilder.java
Date Thu, 28 Apr 2005 00:12:36 GMT
Author: djencks
Date: Wed Apr 27 17:12:34 2005
New Revision: 165072

URL: http://svn.apache.org/viewcvs?rev=165072&view=rev
Log:
copy axis' logic for operationQName, thanks to Gianny for noticing this

Modified:
    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
    geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/OperationDescBuilder.java

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?rev=165072&r1=165071&r2=165072&view=diff
==============================================================================
--- 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
Wed Apr 27 17:12:34 2005
@@ -148,7 +148,7 @@
 
         String soapActionURI = soapOperation.getSoapActionURI();
         boolean usesSOAPAction = (soapActionURI != null);
-        QName operationQName = new QName("", operation.getName());
+        QName operationQName = getOperationQName();
 
         String methodName = methodMapping.getJavaMethodName().getStringValue().trim();
 
@@ -166,6 +166,20 @@
         return operationInfo;
     }
 
+    private QName getOperationQName() {
+        if (wrappedStyle) {
+            Map parts = operation.getInput().getMessage().getParts();
+            if (parts != null && !parts.isEmpty()) {
+                for (Iterator iterator = parts.values().iterator(); iterator.hasNext();)
{
+                    Part part = (Part) iterator.next();
+                    return part.getElementName();
+                }
+            }
+        }
+        return getOperationNameFromSOAPBody();
+
+    }
+
     public OperationDesc buildOperationDesc() throws DeploymentException {
         if (built) {
             return operationDesc;
@@ -645,7 +659,7 @@
     }
 
     private QName getPartName(Part part) {
-        return null == part.getElementName()? part.getTypeName() : part.getElementName();
+        return null == part.getElementName() ? part.getTypeName() : part.getElementName();
     }
 
     private Part getWrappedPart(Message message) throws DeploymentException {

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?rev=165072&r1=165071&r2=165072&view=diff
==============================================================================
--- 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
Wed Apr 27 17:12:34 2005
@@ -57,7 +57,7 @@
         buildOperationDesc();
         String soapActionURI = soapOperation.getSoapActionURI();
         boolean usesSOAPAction = (soapActionURI != null);
-        QName operationQName = new QName("", operation.getName());
+        QName operationQName = getOperationNameFromSOAPBody();
 
         String methodName = method.getName();
         String methodDesc = Type.getMethodDescriptor(method);
@@ -75,7 +75,7 @@
         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();

Modified: geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/OperationDescBuilder.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/OperationDescBuilder.java?rev=165072&r1=165071&r2=165072&view=diff
==============================================================================
--- geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/OperationDescBuilder.java
(original)
+++ geronimo/trunk/modules/axis-builder/src/java/org/apache/geronimo/axis/builder/OperationDescBuilder.java
Wed Apr 27 17:12:34 2005
@@ -16,10 +16,16 @@
  */
 package org.apache.geronimo.axis.builder;
 
+import java.util.Iterator;
+import java.util.List;
 import javax.wsdl.BindingOperation;
 import javax.wsdl.Operation;
 import javax.wsdl.Message;
+import javax.wsdl.BindingInput;
 import javax.wsdl.extensions.soap.SOAPOperation;
+import javax.wsdl.extensions.ExtensibilityElement;
+import javax.xml.namespace.QName;
+import javax.xml.soap.SOAPBody;
 
 import org.apache.geronimo.axis.client.OperationInfo;
 import org.apache.geronimo.common.DeploymentException;
@@ -50,4 +56,17 @@
     public abstract OperationInfo buildOperationInfo(SOAPConstants soapVersion) throws DeploymentException;
 
     public abstract OperationDesc buildOperationDesc() throws DeploymentException;
+
+    protected QName getOperationNameFromSOAPBody() {
+        BindingInput bindingInput = bindingOperation.getBindingInput();
+        List extensibilityElements = bindingInput.getExtensibilityElements();
+        for (Iterator iterator = extensibilityElements.iterator(); iterator.hasNext();) {
+            ExtensibilityElement extensibilityElement = (ExtensibilityElement) iterator.next();
+            if (SOAPBody.class.isAssignableFrom(extensibilityElement.getClass())) {
+                String namespaceURI = ((SOAPBody)extensibilityElement).getNamespaceURI();
+                return new QName(namespaceURI, operationName);
+            }
+        }
+        return new QName("", operationName);
+    }
 }



Mime
View raw message