You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2007/08/08 12:42:52 UTC

svn commit: r563805 - /webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java

Author: deepal
Date: Wed Aug  8 03:42:49 2007
New Revision: 563805

URL: http://svn.apache.org/viewvc?view=rev&rev=563805
Log:
reverting Sankas's changes on services.xml policy

Modified:
    webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java

Modified: webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java?view=diff&rev=563805&r1=563804&r2=563805
==============================================================================
--- webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java (original)
+++ webservices/axis2/branches/java/1_3/modules/kernel/src/org/apache/axis2/description/AxisService2WSDL11.java Wed Aug  8 03:42:49 2007
@@ -348,8 +348,6 @@
             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)
@@ -373,9 +371,6 @@
                             + ":" + 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);
@@ -403,8 +398,6 @@
                             + ":" + 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);
@@ -451,9 +444,6 @@
 
         addPolicyAsExtElement(PolicyInclude.SERVICE_POLICY, axisService
                 .getPolicyInclude(), service);
-        addPolicyAsExtElement(PolicyInclude.AXIS_SERVICE_POLICY, axisService.
-                getPolicyInclude(), service);
-        
         if (!disableREST) {
             generateHTTPPorts(fac, service);
         }
@@ -548,6 +538,8 @@
         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);
 
@@ -589,6 +581,8 @@
 
             addPolicyAsExtElement(PolicyInclude.BINDING_OPERATION_POLICY,
                                   axisOperation.getPolicyInclude(), operation);
+            addPolicyAsExtElement(PolicyInclude.AXIS_OPERATION_POLICY,
+                                  axisOperation.getPolicyInclude(), operation);
 
             String MEP = axisOperation.getMessageExchangePattern();
 
@@ -680,6 +674,8 @@
         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);
 
@@ -721,7 +717,8 @@
 
             addPolicyAsExtElement(PolicyInclude.BINDING_OPERATION_POLICY,
                                   axisOperation.getPolicyInclude(), operation);
-
+            addPolicyAsExtElement(PolicyInclude.AXIS_OPERATION_POLICY,
+                                  axisOperation.getPolicyInclude(), operation);
 
             String MEP = axisOperation.getMessageExchangePattern();
 
@@ -929,7 +926,7 @@
         }
     }
 
-    private void addPolicyAsExtElement(int type, PolicyInclude policyInclude, OMElement parentElement)
+    private void addPolicyAsExtElement(int type, PolicyInclude policyInclude, OMElement element)
             throws Exception {
         ArrayList elementList = policyInclude.getPolicyElements(type);
 
@@ -937,28 +934,14 @@
             Object policyElement = iterator.next();
 
             if (policyElement instanceof Policy) {
-                OMElement child = PolicyUtil.getPolicyComponentAsOMElement(
-                        (PolicyComponent) policyElement, serializer);
-                
-                OMNode firstChildElem = parentElement.getFirstElement();
-                
-                if (firstChildElem == null) {
-                    parentElement.addChild(child);
-                } else {
-                    firstChildElem.insertSiblingBefore(child);
-                }
+                element.addChild(PolicyUtil.getPolicyComponentAsOMElement(
+                        (PolicyComponent) policyElement, serializer));
 
             } else if (policyElement instanceof PolicyReference) {
-                OMElement child = PolicyUtil
-                                .getPolicyComponentAsOMElement((PolicyComponent) policyElement);
-                OMElement firstChildElem = parentElement.getFirstElement();
-                
-                if (firstChildElem == null) {
-                    parentElement.addChild(child);
-                } else {
-                    firstChildElem.insertSiblingBefore(child);
-                }
-                
+                element
+                        .addChild(PolicyUtil
+                                .getPolicyComponentAsOMElement((PolicyComponent) policyElement));
+
                 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