axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sa...@apache.org
Subject svn commit: r392356 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/wsdl/codegen/emitter/ codegen/src/org/apache/axis2/wsdl/codegen/extension/ core/src/org/apache/axis2/description/ core/src/org/apache/axis2/util/
Date Fri, 07 Apr 2006 18:26:36 GMT
Author: sanka
Date: Fri Apr  7 11:26:34 2006
New Revision: 392356

URL: http://svn.apache.org/viewcvs?rev=392356&view=rev
Log:
removing the dependency of PolicyAttachmentUtil class

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/emitter/AxisServiceBasedMultiLanguageEmitter.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2AxisServiceBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/PolicyUtil.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=392356&r1=392355&r2=392356&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
Fri Apr  7 11:26:34 2006
@@ -5,7 +5,7 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.namespace.Constants;
 import org.apache.axis2.util.JavaUtils;
-import org.apache.axis2.util.PolicyAttachmentUtil;
+//import org.apache.axis2.util.PolicyAttachmentUtil;
 import org.apache.axis2.util.PolicyUtil;
 import org.apache.axis2.util.XSLTUtils;
 import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
@@ -129,9 +129,9 @@
     private Map infoHolder;
 
     CodeGenConfiguration codeGenConfiguration;
+    
     protected TypeMapper mapper;
-    protected PolicyAttachmentUtil attachmentUtil;
-
+    
     private AxisService axisService;
 
     public AxisServiceBasedMultiLanguageEmitter() {

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java?rev=392356&r1=392355&r2=392356&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/extension/PolicyEvaluator.java
Fri Apr  7 11:26:34 2006
@@ -16,6 +16,14 @@
 
 package org.apache.axis2.wsdl.codegen.extension;
 
+import java.util.HashMap;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.description.AxisModule;
@@ -26,30 +34,15 @@
 import org.apache.axis2.modules.Module;
 import org.apache.axis2.modules.ModulePolicyExtension;
 import org.apache.axis2.modules.PolicyExtension;
-import org.apache.axis2.util.PolicyAttachmentUtil;
 import org.apache.axis2.wsdl.codegen.CodeGenConfiguration;
 import org.apache.axis2.wsdl.util.XSLTConstants;
 import org.apache.ws.policy.AndCompositeAssertion;
 import org.apache.ws.policy.Policy;
 import org.apache.ws.policy.PrimitiveAssertion;
 import org.apache.ws.policy.XorCompositeAssertion;
-import org.apache.wsdl.WSDLBinding;
-import org.apache.wsdl.WSDLDescription;
-import org.apache.wsdl.WSDLEndpoint;
-import org.apache.wsdl.WSDLInterface;
-import org.apache.wsdl.WSDLOperation;
-import org.apache.wsdl.WSDLService;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-
 /**
  *
  * @author Sanka Samaranayake (sanka@apache.org)
@@ -60,12 +53,8 @@
 	CodeGenConfiguration configuration;
     
     AxisService axisService;
-
-//HashMap ns2modules = new HashMap();
 	
 	HashMap ns2Exts = new HashMap();
-
-//	PolicyAttachmentUtil util;
 
 	Element rootElement;
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2AxisServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2AxisServiceBuilder.java?rev=392356&r1=392355&r2=392356&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2AxisServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/WSDL2AxisServiceBuilder.java
Fri Apr  7 11:26:34 2006
@@ -950,14 +950,14 @@
                             .getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                     Policy policy = policyReader.readPolicy(unknown.getElement());
 
-                    addExtensibilityElementsToAxisDescription(description, originOfExtensibilityElements,
policy);
+                    addPolicy(description, originOfExtensibilityElements, policy);
 
                 } else if (ExtensionConstants.POLICY_REFERENCE.equals(unknown.getElementType()))
{
 
                     DOMPolicyReader policyReader = (DOMPolicyReader) PolicyFactory
                             .getPolicyReader(PolicyFactory.DOM_POLICY_READER);
                     PolicyReference policyRef = policyReader.readPolicyReference(unknown.getElement());
-                    addExtensibilityElementsToAxisDescription(description, originOfExtensibilityElements,
policyRef);
+                    addPolicyRef(description, originOfExtensibilityElements, policyRef);
 
 
                 } else {
@@ -1040,85 +1040,107 @@
         }
     }
 
-    private void addExtensibilityElementsToAxisDescription(AxisDescription description, String
originOfExtensibilityElements, Policy policy) {
+    private void addPolicy(AxisDescription description, String originOfExtensibilityElements,
Policy policy) {
+        
         if (description instanceof AxisService) {
+        	// wsdl:service
             if (SERVICE.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.SERVICE_POLICY,
policy);
-
+            
+            // wsdl:service -> wsdl:port
             } else if (PORT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.PORT_POLICY,
policy);
 
+            // wsdl:binding
             } else if (BINDING.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.BINDING_POLICY,
policy);
             }
+            
+            //TODO wsdl:portType ?
 
         } else if (description instanceof AxisOperation) {
-
+            
+            // wsdl:portType -> wsdl:operation
             if (PORT_TYPE_OPERATION.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.OPERATION_POLICY,
policy);
 
-            } else if (BINDING_OPERATION.equals(originOfExtensibilityElements)) {
+            // wsdl:binding -> wsdl:operation
+            } else {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.BINDING_POLICY,
policy);
             }
 
-        } else if (description instanceof AxisMessage) {
-
+        } else {
+        	
+            // wsdl:portType -> wsdl:operation -> wsdl:input
             if (PORT_TYPE_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.INPUT_POLICY,
policy);
 
+            // wsdl:binding -> wsdl:operation -> wsdl:input
             } else if (BINDING_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.BINDING_INPUT_POLICY,
policy);
 
+            // wsdl:portType -> wsdl:operation -> wsdl:put
             } else if (PORT_TYPE_OPERATION_OUTPUT.equals(originOfExtensibilityElements))
{
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.OUTPUT_POLICY,
policy);
 
+            // wsdl:binding -> wsdl:operation -> wsdl:output
             } else if (BINDING_OPERATION_OUTPUT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyElement(PolicyInclude.BINDING_OUTPUT_POLICY,
policy);
             }
-
+            
             //TODO Faults ..
-
         }
     }
 
-    private void addExtensibilityElementsToAxisDescription(AxisDescription description, String
originOfExtensibilityElements, PolicyReference policyRefElement) {
+    private void addPolicyRef(AxisDescription description, String originOfExtensibilityElements,
PolicyReference policyRefElement) {
+        
         if (description instanceof AxisService) {
+            // wsdl:service
             if (SERVICE.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.SERVICE_POLICY,
policyRefElement);
-
+            
+            // wsdl:service -> wsdl:port
             } else if (PORT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.PORT_POLICY,
policyRefElement);
 
+            // wsdl:binding
             } else if (BINDING.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.BINDING_POLICY,
policyRefElement);
             }
+            
+            //TODO wsdl:portType ?
 
         } else if (description instanceof AxisOperation) {
-
+            
+            // wsdl:portType -> wsdl:operation
             if (PORT_TYPE_OPERATION.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.OPERATION_POLICY,
policyRefElement);
 
-            } else if (BINDING_OPERATION.equals(originOfExtensibilityElements)) {
+            // wsdl:binding -> wsdl:operation
+            } else {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.BINDING_POLICY,
policyRefElement);
             }
 
-        } else if (description instanceof AxisMessage) {
-
+        } else {
+            
+            // wsdl:portType -> wsdl:operation -> wsdl:input
             if (PORT_TYPE_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.INPUT_POLICY,
policyRefElement);
 
+            // wsdl:binding -> wsdl:operation -> wsdl:input
             } else if (BINDING_OPERATION_INPUT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.BINDING_INPUT_POLICY,
policyRefElement);
 
+            // wsdl:portType -> wsdl:operation -> wsdl:put
             } else if (PORT_TYPE_OPERATION_OUTPUT.equals(originOfExtensibilityElements))
{
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.OUTPUT_POLICY,
policyRefElement);
 
+            // wsdl:binding -> wsdl:operation -> wsdl:output
             } else if (BINDING_OPERATION_OUTPUT.equals(originOfExtensibilityElements)) {
                 description.getPolicyInclude().addPolicyRefElement(PolicyInclude.BINDING_OUTPUT_POLICY,
policyRefElement);
             }
-
+            
             //TODO Faults ..
-
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/PolicyUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/PolicyUtil.java?rev=392356&r1=392355&r2=392356&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/PolicyUtil.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/util/PolicyUtil.java Fri
Apr  7 11:26:34 2006
@@ -16,338 +16,19 @@
 
 package org.apache.axis2.util;
 
-import org.apache.axis2.description.AxisDescWSDLComponentFactory;
-import org.apache.axis2.description.AxisMessage;
-import org.apache.axis2.description.AxisOperation;
-import org.apache.axis2.description.AxisService;
-import org.apache.axis2.description.AxisServiceGroup;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+
 import org.apache.axis2.description.PolicyInclude;
-import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.ws.policy.Policy;
-import org.apache.ws.policy.PolicyConstants;
-import org.apache.ws.policy.PolicyReference;
 import org.apache.ws.policy.util.PolicyFactory;
 import org.apache.ws.policy.util.PolicyWriter;
 import org.apache.ws.policy.util.StAXPolicyWriter;
-import org.apache.wsdl.Component;
-import org.apache.wsdl.WSDLBinding;
-import org.apache.wsdl.WSDLBindingOperation;
-import org.apache.wsdl.WSDLConstants;
-import org.apache.wsdl.WSDLDescription;
-import org.apache.wsdl.WSDLEndpoint;
-import org.apache.wsdl.WSDLExtensibilityAttribute;
-import org.apache.wsdl.WSDLInterface;
-import org.apache.wsdl.WSDLOperation;
-import org.apache.wsdl.WSDLService;
-import org.apache.wsdl.extensions.ExtensionConstants;
-import org.apache.wsdl.extensions.PolicyExtensibilityElement;
-import org.apache.wsdl.extensions.impl.ExtensionFactoryImpl;
-import org.apache.wsdl.impl.WSDLProcessingException;
-
-import javax.xml.namespace.QName;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.util.Iterator;
-import java.util.List;
 
 public class PolicyUtil {
-
-	public static void populatePolicy(WSDLDescription description,
-			AxisService axisService) {
-		WSDLService wsdlService = description.getService(new QName(axisService
-				.getName()));
-		populatePolicy(description, wsdlService, axisService);
-	}
-
-	private static void populatePolicy(WSDLDescription description,
-			WSDLService wsdlService, AxisService axisService) {
-
-		AxisServiceGroup axisServiceGroup = null;
-		AxisConfiguration axisConfiguration = null;
-
-		axisServiceGroup = (AxisServiceGroup) axisService.getParent();
-
-		if (axisServiceGroup != null) {
-			axisConfiguration = (AxisConfiguration) axisServiceGroup
-					.getParent();
-		}
-
-		PolicyInclude servicePolicyInclude = axisService.getPolicyInclude();
-
-		List policyList;
-
-		// Policies defined in Axis2.xml
-		if (axisConfiguration != null) {
-			policyList = axisConfiguration.getPolicyInclude()
-					.getPolicyElements(PolicyInclude.AXIS_POLICY);
-			addPolicyAsExtElements(description, policyList, wsdlService,
-					servicePolicyInclude);
-		}
-
-		// Policies defined in wsdl:Service
-		policyList = servicePolicyInclude
-				.getPolicyElements(PolicyInclude.SERVICE_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlService,
-				servicePolicyInclude);
-
-		Iterator wsdlEndpoints = wsdlService.getEndpoints().values().iterator();
-		if (!wsdlEndpoints.hasNext()) {
-			throw new WSDLProcessingException("should at least one endpoints");
-		}
-
-		WSDLEndpoint wsdlEndpoint = (WSDLEndpoint) wsdlEndpoints.next();
-		populatePolicy(description, wsdlEndpoint, axisService);
-	}
-
-	private static void populatePolicy(WSDLDescription description,
-			WSDLEndpoint wsdlEndpoint, AxisService axisService) {
-		PolicyInclude policyInclude = axisService.getPolicyInclude();
-		List policyList = policyInclude
-				.getPolicyElements(PolicyInclude.PORT_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlEndpoint,
-				policyInclude);
-
-		WSDLBinding wsdlBinding = wsdlEndpoint.getBinding();
-		populatePolicy(description, wsdlBinding, axisService);
-		WSDLInterface wsdlInterface = wsdlBinding.getBoundInterface();
-		populatePolicy(description, wsdlInterface, axisService);
-
-	}
-
-	private static void populatePolicy(WSDLDescription description,
-			WSDLInterface wsdlInterface, AxisService axisService) {
-		PolicyInclude policyInclude = axisService.getPolicyInclude();
-		List policyList = policyInclude
-				.getPolicyElements(PolicyInclude.PORT_TYPE_POLICY);
-		// addPolicyAsExtAttributes(description, policyList, wsdlInterface,
-		// policyInclude);
-
-		Iterator wsdlOperations = wsdlInterface.getOperations().values()
-				.iterator();
-		WSDLOperation wsdlOperation;
-
-		while (wsdlOperations.hasNext()) {
-			wsdlOperation = (WSDLOperation) wsdlOperations.next();
-			populatePolicy(description, wsdlOperation, axisService
-					.getOperation(wsdlOperation.getName()));
-
-		}
-	}
-
-	private static void populatePolicy(WSDLDescription description,
-			WSDLOperation wsdlOperation, AxisOperation axisOperation) {
-
-		PolicyInclude policyInclude = axisOperation.getPolicyInclude();
-
-		// wsdl:PortType -> wsdl:Operation
-		List policyList = policyInclude
-				.getPolicyElements(PolicyInclude.OPERATION_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlOperation,
-				policyInclude);
-
-		if (WSDLConstants.MEP_URI_IN_ONLY.equals(axisOperation
-				.getMessageExchangePattern())) {
-			AxisMessage input = axisOperation
-					.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-			PolicyInclude policyInclude2 = input.getPolicyInclude();
-
-			// wsdl:PortType -> wsdl:Operation -> wsdl:Input
-			List policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.INPUT_POLICY);
-			addPolicyAsExtAttributes(description, policyList2, wsdlOperation
-					.getInputMessage(), policyInclude2);
-
-		} else if (WSDLConstants.MEP_URI_IN_OUT.equals(axisOperation
-				.getMessageExchangePattern())) {
-			PolicyInclude policyInclude2;
-			List policyList2;
-
-			AxisMessage input = axisOperation
-					.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-			policyInclude2 = input.getPolicyInclude();
-
-			// wsdl:PortType -> wsdl:Operation -> wsdl:Input
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.INPUT_POLICY);
-			addPolicyAsExtAttributes(description, policyList2, wsdlOperation
-					.getInputMessage(), policyInclude2);
-
-			AxisMessage output = axisOperation
-					.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-			policyInclude2 = output.getPolicyInclude();
-
-			// wsdl:PortType -> wsdl:Operation -> wsdl:Output
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.OUTPUT_POLICY);
-			addPolicyAsExtAttributes(description, policyList2, wsdlOperation
-					.getOutputMessage(), policyInclude2);
-		}
-	}
-
-	private static void populatePolicy(WSDLDescription description,
-			WSDLBinding wsdlBinding, AxisService axisService) {
-		PolicyInclude policyInclude = axisService.getPolicyInclude();
-
-		List policyList = policyInclude
-				.getPolicyElements(PolicyInclude.AXIS_SERVICE_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlBinding,
-				policyInclude);
-
-		policyList = policyInclude
-				.getPolicyElements(PolicyInclude.BINDING_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlBinding,
-				policyInclude);
-
-		Iterator wsdlOperations = wsdlBinding.getBindingOperations().values()
-				.iterator();
-		WSDLBindingOperation wsdlBindingOperation;
-
-		while (wsdlOperations.hasNext()) {
-			wsdlBindingOperation = (WSDLBindingOperation) wsdlOperations.next();
-			populatePolicy(description, wsdlBindingOperation, axisService
-					.getOperation(wsdlBindingOperation.getName()));
-		}
-	}
-
-	private static void populatePolicy(WSDLDescription description,
-			WSDLBindingOperation wsdlBindingOperation,
-			AxisOperation axisOperation) {
-
-		PolicyInclude policyInclude = axisOperation.getPolicyInclude();
-		List policyList = policyInclude
-				.getPolicyElements(PolicyInclude.BINDING_OPERATION_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlBindingOperation,
-				policyInclude);
-
-		//
-		policyList = policyInclude
-				.getPolicyElements(PolicyInclude.AXIS_OPERATION_POLICY);
-		addPolicyAsExtElements(description, policyList, wsdlBindingOperation,
-				policyInclude);
-
-		if (WSDLConstants.MEP_URI_IN_ONLY.equals(axisOperation
-				.getMessageExchangePattern())) {
-			AxisMessage input = axisOperation
-					.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-			PolicyInclude policyInclude2 = input.getPolicyInclude();
-
-			// wsdl:Binding -> wsdl:Operation -> wsdl:Input
-			List policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.INPUT_POLICY);
-			addPolicyAsExtElements(description, policyList2,
-					wsdlBindingOperation.getInput(), policyInclude2);
-
-			//
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
-			addPolicyAsExtElements(description, policyList2,
-					wsdlBindingOperation.getInput(), policyInclude2);
-
-		} else if (WSDLConstants.MEP_URI_IN_OUT.equals(axisOperation
-				.getMessageExchangePattern())) {
-			PolicyInclude policyInclude2;
-			List policyList2;
-
-			AxisMessage input = axisOperation
-					.getMessage(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
-			policyInclude2 = input.getPolicyInclude();
-
-			// wsdl:Binding -> wsdl:Operation -> wsdl:Input
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.INPUT_POLICY);
-			addPolicyAsExtElements(description, policyList2,
-					wsdlBindingOperation.getInput(), policyInclude2);
-			// 
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
-			addPolicyAsExtElements(description, policyList2,
-					wsdlBindingOperation.getInput(), policyInclude2);
-
-			AxisMessage output = axisOperation
-					.getMessage(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);
-			policyInclude2 = output.getPolicyInclude();
-
-			// wsdl:Binding -> wsdl:Operation -> wsdl:Output
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.OUTPUT_POLICY);
-			addPolicyAsExtElements(description, policyList2,
-					wsdlBindingOperation.getOutput(), policyInclude2);
-			// 
-			policyList2 = policyInclude2
-					.getPolicyElements(PolicyInclude.AXIS_MESSAGE_POLICY);
-			addPolicyAsExtElements(description, policyList2,
-					wsdlBindingOperation.getInput(), policyInclude2);
-		}
-	}
-
-	// private static void addPolicyToComponent(Policy policy, Component
-	// component) {
-	// component.addExtensibilityElement(getExtensibilityElement(policy));
-	// }
-
-	private static PolicyExtensibilityElement getExtensibilityElement(
-			Object policyElement) {
-		PolicyExtensibilityElement element = (PolicyExtensibilityElement) (new ExtensionFactoryImpl())
-				.getExtensionElement(ExtensionConstants.POLICY);
-		element.setPolicyElement(policyElement);
-		return element;
-	}
-
-	private static WSDLExtensibilityAttribute getExtensibilitiyAttribute(
-			PolicyReference policyReference) {
-		WSDLExtensibilityAttribute extensibilityAttribute = new AxisDescWSDLComponentFactory()
-				.createWSDLExtensibilityAttribute();
-		extensibilityAttribute.setKey(new QName(
-				PolicyConstants.WSU_NAMESPACE_URI, "PolicyURIs"));
-		extensibilityAttribute.setValue(new QName(policyReference
-				.getPolicyURIString()));
-		return extensibilityAttribute;
-	}
-
-	private static void addPolicyAsExtElements(WSDLDescription description,
-			List policyList, Component component, PolicyInclude policyInclude) {
-		Iterator policyElementIterator = policyList.iterator();
-		Object policyElement;
-
-		while (policyElementIterator.hasNext()) {
-			policyElement = policyElementIterator.next();
-
-			if (policyElement instanceof PolicyReference) {
-				String policyURIString = ((PolicyReference) policyElement)
-						.getPolicyURIString();
-				description
-						.addExtensibilityElement(getExtensibilityElement(policyInclude
-								.getPolicy(policyURIString)));
-			}
-
-			component
-					.addExtensibilityElement(getExtensibilityElement(policyElement));
-		}
-	}
-
-	private static void addPolicyAsExtAttributes(WSDLDescription description,
-			List policyList, Component component, PolicyInclude policyInclude) {
-		Iterator policyElementIterator = policyList.iterator();
-		Object policyElement;
-
-		while (policyElementIterator.hasNext()) {
-			policyElement = policyElementIterator.next();
-
-			if (policyElement instanceof PolicyReference) {
-				String policyURIString = ((PolicyReference) policyElement)
-						.getPolicyURIString();
-				component
-						.addExtensibleAttributes(getExtensibilitiyAttribute((PolicyReference) policyElement));
-				description
-						.addExtensibilityElement(getExtensibilityElement(policyInclude
-								.getPolicy(policyURIString)));
-
-			}
-		}
-	}
-
+    
 	public static void writePolicy(PolicyInclude policy, OutputStream out) {
 		if (policy != null) {
 			Policy pl = policy.getEffectivePolicy();



Mime
View raw message