You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by sa...@apache.org on 2007/08/07 10:24:47 UTC

svn commit: r563421 - /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java

Author: sanka
Date: Tue Aug  7 01:24:46 2007
New Revision: 563421

URL: http://svn.apache.org/viewvc?view=rev&rev=563421
Log:
Applied the patch provided in AXIS2-3080.


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?view=diff&rev=563421&r1=563420&r2=563421
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java Tue Aug  7 01:24:46 2007
@@ -348,6 +348,8 @@
             operation.addAttribute(ATTRIBUTE_NAME, operationName, null);
             addPolicyAsExtElement(PolicyInclude.OPERATION_POLICY, axisOperation
                     .getPolicyInclude(), operation);
+            addPolicyAsExtElement(PolicyInclude.AXIS_OPERATION_POLICY, axisOperation
+                    .getPolicyInclude(), operation);
 
             String MEP = axisOperation.getMessageExchangePattern();
             if (WSDL2Constants.MEP_URI_IN_ONLY.equals(MEP)
@@ -371,6 +373,9 @@
                             + ":" + inaxisMessage.getName(), null);
                     addPolicyAsExtElement(PolicyInclude.INPUT_POLICY,
                                           inaxisMessage.getPolicyInclude(), input);
+                    addPolicyAsExtElement(PolicyInclude.AXIS_MESSAGE_POLICY,
+                                          inaxisMessage.getPolicyInclude(), input);
+                    
                     WSDLSerializationUtil.addWSAWActionAttribute(input, axisOperation
                             .getInputAction(),wsaw);
                     operation.addChild(input);
@@ -398,6 +403,8 @@
                             + ":" + outAxisMessage.getName(), null);
                     addPolicyAsExtElement(PolicyInclude.OUTPUT_POLICY,
                                           outAxisMessage.getPolicyInclude(), output);
+                    addPolicyAsExtElement(PolicyInclude.AXIS_MESSAGE_POLICY,
+                            outAxisMessage.getPolicyInclude(), output);
                     WSDLSerializationUtil.addWSAWActionAttribute(output, axisOperation
                             .getOutputAction(),wsaw);
                     operation.addChild(output);
@@ -444,6 +451,9 @@
 
         addPolicyAsExtElement(PolicyInclude.SERVICE_POLICY, axisService
                 .getPolicyInclude(), service);
+        addPolicyAsExtElement(PolicyInclude.AXIS_SERVICE_POLICY, axisService.
+                getPolicyInclude(), service);
+        
         if (!disableREST) {
             generateHTTPPorts(fac, service);
         }
@@ -538,8 +548,6 @@
         binding.addAttribute("type", tns.getPrefix() + ":"
                 + axisService.getName() + PORT_TYPE_SUFFIX, null);
 
-        addPolicyAsExtElement(PolicyInclude.AXIS_SERVICE_POLICY, axisService
-                .getPolicyInclude(), binding);
         addPolicyAsExtElement(PolicyInclude.BINDING_POLICY, axisService
                 .getPolicyInclude(), binding);
 
@@ -581,8 +589,6 @@
 
             addPolicyAsExtElement(PolicyInclude.BINDING_OPERATION_POLICY,
                                   axisOperation.getPolicyInclude(), operation);
-            addPolicyAsExtElement(PolicyInclude.AXIS_OPERATION_POLICY,
-                                  axisOperation.getPolicyInclude(), operation);
 
             String MEP = axisOperation.getMessageExchangePattern();
 
@@ -674,8 +680,6 @@
         binding.addAttribute("type", tns.getPrefix() + ":"
                 + axisService.getName() + PORT_TYPE_SUFFIX, null);
 
-        addPolicyAsExtElement(PolicyInclude.AXIS_SERVICE_POLICY, axisService
-                .getPolicyInclude(), binding);
         addPolicyAsExtElement(PolicyInclude.BINDING_POLICY, axisService
                 .getPolicyInclude(), binding);
 
@@ -717,8 +721,7 @@
 
             addPolicyAsExtElement(PolicyInclude.BINDING_OPERATION_POLICY,
                                   axisOperation.getPolicyInclude(), operation);
-            addPolicyAsExtElement(PolicyInclude.AXIS_OPERATION_POLICY,
-                                  axisOperation.getPolicyInclude(), operation);
+
 
             String MEP = axisOperation.getMessageExchangePattern();
 
@@ -926,7 +929,7 @@
         }
     }
 
-    private void addPolicyAsExtElement(int type, PolicyInclude policyInclude, OMElement element)
+    private void addPolicyAsExtElement(int type, PolicyInclude policyInclude, OMElement parentElement)
             throws Exception {
         ArrayList elementList = policyInclude.getPolicyElements(type);
 
@@ -934,14 +937,28 @@
             Object policyElement = iterator.next();
 
             if (policyElement instanceof Policy) {
-                element.addChild(PolicyUtil.getPolicyComponentAsOMElement(
-                        (PolicyComponent) policyElement, serializer));
+                OMElement child = PolicyUtil.getPolicyComponentAsOMElement(
+                        (PolicyComponent) policyElement, serializer);
+                
+                OMNode firstChildElem = parentElement.getFirstElement();
+                
+                if (firstChildElem == null) {
+                    parentElement.addChild(child);
+                } else {
+                    firstChildElem.insertSiblingBefore(child);
+                }
 
             } else if (policyElement instanceof PolicyReference) {
-                element
-                        .addChild(PolicyUtil
-                                .getPolicyComponentAsOMElement((PolicyComponent) policyElement));
-
+                OMElement child = PolicyUtil
+                                .getPolicyComponentAsOMElement((PolicyComponent) policyElement);
+                OMElement firstChildElem = parentElement.getFirstElement();
+                
+                if (firstChildElem == null) {
+                    parentElement.addChild(child);
+                } else {
+                    firstChildElem.insertSiblingBefore(child);
+                }
+                
                 PolicyRegistry reg = policyInclude.getPolicyRegistry();
                 String key = ((PolicyReference) policyElement).getURI();
 



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