axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: r392527 - /webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Date Sat, 08 Apr 2006 13:59:31 GMT
Author: ajith
Date: Sat Apr  8 06:59:30 2006
New Revision: 392527

URL: http://svn.apache.org/viewcvs?rev=392527&view=rev
Log:
A minor mistake in the emitter which made it crash for certain WSDL's that are missing either
the input or the output.

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java?rev=392527&r1=392526&r2=392527&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
Sat Apr  8 06:59:30 2006
@@ -455,14 +455,14 @@
 
         PolicyInclude policyInclude = axisService.getPolicyInclude();
         Policy servicePolicy = policyInclude.getPolicy();
-        
+
         if (servicePolicy != null) {
-        	String policyString = PolicyUtil.getPolicyAsString(servicePolicy);
-        	addAttribute(doc, "policy", policyString, rootElement);
+            String policyString = PolicyUtil.getPolicyAsString(servicePolicy);
+            addAttribute(doc, "policy", policyString, rootElement);
         }
 
         Element endpointElement = doc.createElement("endpoint");
-        
+
         String endpoint = axisService.getEndpoint();
         Text text = doc.createTextNode((endpoint != null)
                 ? endpoint
@@ -774,17 +774,30 @@
             // this step is needed to remove repetitions
 
             // process the input parameters
-            Element inputParamElement = getInputParamElement(doc, axisOperation);
-            if (inputParamElement != null) {
-                parameterMap.put(inputParamElement.getAttribute("type"), inputParamElement);
+            String MEP = axisOperation.getMessageExchangePattern();
+            if (WSDLConstants.MEP_URI_IN_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+                Element inputParamElement = getInputParamElement(doc, axisOperation);
+                if (inputParamElement != null) {
+                    parameterMap.put(inputParamElement.getAttribute("type"), inputParamElement);
+                }
             }
-
             // process output parameters
-            Element outputParamElement = getOutputParamElement(doc, axisOperation);
-            if (outputParamElement != null) {
-                parameterMap.put(outputParamElement.getAttribute("type"), outputParamElement);
+            if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                    WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+                Element outputParamElement = getOutputParamElement(doc, axisOperation);
+                if (outputParamElement != null) {
+                    parameterMap.put(outputParamElement.getAttribute("type"), outputParamElement);
+                }
             }
-
             //process faults
             Element[] faultParamElements = getFaultParamElements(doc, axisOperation);
             for (int i = 0; i < faultParamElements.length; i++) {
@@ -1258,18 +1271,25 @@
 
     protected Element getInputElement(Document doc, AxisOperation operation, List headerParameterQNameList)
{
         Element inputElt = doc.createElement("input");
-        Element param = getInputParamElement(doc, operation);
+        String MEP = operation.getMessageExchangePattern();
+        if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            Element param = getInputParamElement(doc, operation);
 
-        if (param != null) {
-            inputElt.appendChild(param);
-        }
+            if (param != null) {
+                inputElt.appendChild(param);
+            }
 
-        List parameterElementList = getParameterElementList(doc, headerParameterQNameList,
"header");
+            List parameterElementList = getParameterElementList(doc, headerParameterQNameList,
"header");
 
-        for (int i = 0; i < parameterElementList.size(); i++) {
-            inputElt.appendChild((Element) parameterElementList.get(i));
+            for (int i = 0; i < parameterElementList.size(); i++) {
+                inputElt.appendChild((Element) parameterElementList.get(i));
+            }
         }
-
         return inputElt;
     }
 
@@ -1298,17 +1318,24 @@
      */
     protected Element getOutputElement(Document doc, AxisOperation operation, List headerParameterQNameList)
{
         Element outputElt = doc.createElement("output");
-        Element param = getOutputParamElement(doc, operation);
-
-        if (param != null) {
-            outputElt.appendChild(param);
-        }
-
-        List outputElementList = getParameterElementList(doc, headerParameterQNameList, "header");
-        for (int i = 0; i < outputElementList.size(); i++) {
-            outputElt.appendChild((Element) outputElementList.get(i));
+        String MEP = operation.getMessageExchangePattern();
+        if (WSDLConstants.MEP_URI_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_OUT_OPTIONAL_IN.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OPTIONAL_OUT.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_OUT_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_ROBUST_IN_ONLY.equals(MEP) ||
+                WSDLConstants.MEP_URI_IN_OUT.equals(MEP)) {
+            Element param = getOutputParamElement(doc, operation);
+
+            if (param != null) {
+                outputElt.appendChild(param);
+            }
+
+            List outputElementList = getParameterElementList(doc, headerParameterQNameList,
"header");
+            for (int i = 0; i < outputElementList.size(); i++) {
+                outputElt.appendChild((Element) outputElementList.get(i));
+            }
         }
-
         return outputElt;
     }
 



Mime
View raw message