axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kei...@apache.org
Subject svn commit: r480830 - in /webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter: AxisServiceBasedMultiLanguageEmitter.java CEmitter.java
Date Thu, 30 Nov 2006 04:33:59 GMT
Author: keithc
Date: Wed Nov 29 20:33:55 2006
New Revision: 480830

URL: http://svn.apache.org/viewvc?view=rev&rev=480830
Log:
Added a method to AxisServiceBasedMultiLanguageEmitter to get binding specific properties

Modified:
    webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?view=diff&rev=480830&r1=480829&r2=480830
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Wed Nov 29 20:33:55 2006
@@ -179,6 +179,23 @@
         this.mapper = mapper;
     }
 
+    private Object getAxisBindingProperty(String name, QName qName){
+
+        // Get the correct AxisBindingOperation coresponding to the AxisOperation
+        AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(qName);
+        Object property = axisBindingOperation.getProperty(name);
+
+        if (property == null) {
+            property = axisBinding.getProperty(name);
+        }
+
+        if (property == null) {
+            property = WSDL20DefaultValueHolder.getDefaultValue(name);
+        }
+
+        return property;
+    }
+
 
     /**
      * Update mapper for the stub
@@ -1195,8 +1212,6 @@
         {
             AxisOperation axisOperation = (AxisOperation) operationsIterator.next();
 
-            // Get the correct AxisBindingOperation coresponding to the AxisOperation
-            AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(axisOperation.getName());
             // Add the parameters to a map with their type as the key
             // this step is needed to remove repetitions
 
@@ -1661,21 +1676,20 @@
         while (operations.hasNext()) {
             AxisOperation axisOperation = (AxisOperation) operations.next();
 
-            // Get the correct AxisBindingOperation coresponding to the AxisOperation
-            AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(axisOperation.getName());
+
 
             // populate info holder with mep information. This will used in determining which
             // message receiver to use, etc.,
 
 
-            String messageExchangePattern = (String) axisBindingOperation.getProperty(WSDL2Constants.ATTR_WSOAP_MEP);
+            String messageExchangePattern = (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_MEP,axisOperation.getName());
             if (infoHolder.get(messageExchangePattern) == null) {
                 infoHolder.put(messageExchangePattern, Boolean.TRUE);
             }
 
             if (mep == null) {
                 opsFound = true;
-                methodElement = generateMethodElement(doc, serviceName, axisOperation, axisBindingOperation);
+                methodElement = generateMethodElement(doc, serviceName, axisOperation);
                 rootElement.appendChild(methodElement);
 
             } else {
@@ -1684,7 +1698,7 @@
                 if (mep.equals(axisOperation.getMessageExchangePattern())) {
                     //at this point we know it's true
                     opsFound = true;
-                    methodElement = generateMethodElement(doc, serviceName, axisOperation,
axisBindingOperation);
+                    methodElement = generateMethodElement(doc, serviceName, axisOperation);
                     rootElement.appendChild(methodElement);
                     //////////////////////
                 }
@@ -1704,7 +1718,7 @@
      * @return generated element
      * @throws DOMException
      */
-    private Element generateMethodElement(Document doc, String endpointName, AxisOperation
axisOperation, AxisBindingOperation axisBindingOperation) throws DOMException {
+    private Element generateMethodElement(Document doc, String endpointName, AxisOperation
axisOperation) throws DOMException {
         Element methodElement;
         List soapHeaderInputParameterList = new ArrayList();
         List soapHeaderOutputParameterList = new ArrayList();
@@ -1716,7 +1730,7 @@
         addAttribute(doc, "style", axisOperation.getStyle(), methodElement);
         addAttribute(doc, "dbsupportname", endpointName + localPart + DATABINDING_SUPPORTER_NAME_SUFFIX,
                 methodElement);
-        String messageExchangePattern = (String) axisBindingOperation.getProperty(WSDL2Constants.ATTR_WSOAP_MEP);
+        String messageExchangePattern = (String) getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_MEP,axisOperation.getName());
         addAttribute(doc, "mep", Utils.getAxisSpecifMEPConstant(messageExchangePattern) +
"", methodElement);
         addAttribute(doc, "mepURI", messageExchangePattern, methodElement);
 
@@ -1732,7 +1746,7 @@
             addAttribute(doc, "usdbimpl", "false", methodElement);
         }
 
-        addSOAPAction(doc, methodElement, axisBindingOperation);
+        addSOAPAction(doc, methodElement, axisOperation.getName());
         addOutputAndFaultActions(doc, methodElement, axisOperation);
         addHeaderOperations(soapHeaderInputParameterList, axisOperation, true);
         addHeaderOperations(soapHeaderOutputParameterList, axisOperation, false);
@@ -1886,10 +1900,10 @@
      *
      * @param doc
      * @param rootElement
-     * @param axisBindingOperation
+     * @param qName
      */
-    protected void addSOAPAction(Document doc, Element rootElement, AxisBindingOperation
axisBindingOperation) {
-        addAttribute(doc, "soapaction", (String)axisBindingOperation.getProperty(WSDL2Constants.ATTR_WSOAP_ACTION),
rootElement);
+    protected void addSOAPAction(Document doc, Element rootElement, QName qName) {
+        addAttribute(doc, "soapaction", (String)getAxisBindingProperty(WSDL2Constants.ATTR_WSOAP_ACTION,qName),
rootElement);
     }
 
     /**

Modified: webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java?view=diff&rev=480830&r1=480829&r2=480830
==============================================================================
--- webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
(original)
+++ webservices/axis2/branches/java/WSDL_2_0/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/CEmitter.java
Wed Nov 29 20:33:55 2006
@@ -342,9 +342,6 @@
         while (operations.hasNext()) {
             AxisOperation axisOperation = (AxisOperation) operations.next();
 
-            // Get the correct AxisBindingOperation coresponding to the AxisOperation
-            AxisBindingOperation axisBindingOperation = (AxisBindingOperation) axisBinding.getChild(axisOperation.getName());
-
             // populate info holder with mep information. This will used in determining which
             // message receiver to use, etc.,
 
@@ -381,7 +378,7 @@
                 addAttribute(doc, "mepURI", axisOperation.getMessageExchangePattern(), methodElement);
 
 
-                addSOAPAction(doc, methodElement, axisBindingOperation);
+                addSOAPAction(doc, methodElement, axisOperation.getName());
                 //add header ops for input
                 addHeaderOperations(soapHeaderInputParameterList, axisOperation, true);
                 //add header ops for output
@@ -428,7 +425,7 @@
                     addAttribute(doc, "mepURI", axisOperation.getMessageExchangePattern(),
methodElement);
 
 
-                    addSOAPAction(doc, methodElement, axisBindingOperation);
+                    addSOAPAction(doc, methodElement, axisOperation.getName());
                     addHeaderOperations(soapHeaderInputParameterList, axisOperation, true);
                     addHeaderOperations(soapHeaderOutputParameterList, axisOperation, false);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message