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 sa...@apache.org on 2007/03/13 09:48:48 UTC

svn commit: r517591 - in /webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2: deployment/ModuleBuilder.java description/AxisService.java description/PolicyInclude.java transport/http/AbstractHTTPSender.java

Author: sanka
Date: Tue Mar 13 01:48:47 2007
New Revision: 517591

URL: http://svn.apache.org/viewvc?view=rev&rev=517591
Log:
Fixed: ModuleBuilder to add policies that are defined in 
at the operation scope in the module.xml

Fixed: AbsractHTTPSender to set 80 as the default
Web port, and 443 as the default SSL port.


Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java?view=diff&rev=517591&r1=517590&r2=517591
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/ModuleBuilder.java Tue Mar 13 01:48:47 2007
@@ -270,6 +270,20 @@
             // Process Module Refs
             Iterator modules = operation.getChildrenWithName(new QName(TAG_MODULE));
             processOperationModuleRefs(modules, op_descrip);
+            
+//          processing <wsp:Policy> .. </..> elements
+            Iterator policyElements = operation.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY));
+
+            if (policyElements != null && policyElements.hasNext()) {
+                processPolicyElements(PolicyInclude.AXIS_MODULE_OPERATION_POLICY, policyElements, op_descrip.getPolicyInclude());
+            }
+
+            // processing <wsp:PolicyReference> .. </..> elements
+            Iterator policyRefElements = operation.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY_REF));
+
+            if (policyRefElements != null && policyElements.hasNext()) {
+                processPolicyRefElements(PolicyInclude.AXIS_MODULE_OPERATION_POLICY, policyRefElements, module.getPolicyInclude());
+            }
 
             // setting Operation phase
             PhasesInfo info = axisConfig.getPhasesInfo();
@@ -278,6 +292,7 @@
             } catch (AxisFault axisFault) {
                 throw new DeploymentException(axisFault);
             }
+            
 
             // adding the operation
             operations.add(op_descrip);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java?view=diff&rev=517591&r1=517590&r2=517591
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService.java Tue Mar 13 01:48:47 2007
@@ -49,6 +49,7 @@
 import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
+import org.apache.neethi.Policy;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaElement;
 import org.apache.ws.commons.schema.XmlSchemaExternal;
@@ -587,6 +588,17 @@
             operation.addParameter(parameter);
         }
 
+        PolicyInclude policyInclude = new PolicyInclude(operation);
+        PolicyInclude axisOperationPolicyInclude = axisOperation.getPolicyInclude();
+        
+        if (axisOperationPolicyInclude != null) {
+            Policy policy = axisOperationPolicyInclude.getPolicy();
+            if (policy != null) {
+                policyInclude.setPolicy(axisOperationPolicyInclude.getPolicy());
+            }
+        }
+        operation.setPolicyInclude(policyInclude);
+        
         operation.setWsamappingList(axisOperation.getWsamappingList());
         operation.setRemainingPhasesInFlow(axisOperation.getRemainingPhasesInFlow());
         operation.setPhasesInFaultFlow(axisOperation.getPhasesInFaultFlow());

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java?view=diff&rev=517591&r1=517590&r2=517591
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/PolicyInclude.java Tue Mar 13 01:48:47 2007
@@ -33,6 +33,8 @@
     public static final int AXIS_POLICY = 1;
 
     public static final int AXIS_MODULE_POLICY = 2;
+    
+    public static final int AXIS_MODULE_OPERATION_POLICY = 17;
 
     public static final int AXIS_SERVICE_POLICY = 3;
 

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java?view=diff&rev=517591&r1=517590&r2=517591
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/transport/http/AbstractHTTPSender.java Tue Mar 13 01:48:47 2007
@@ -62,7 +62,10 @@
     protected String httpVersion = HTTPConstants.HEADER_PROTOCOL_11;
     private static final Log log = LogFactory.getLog(AbstractHTTPSender.class);
     int soTimeout = HTTPConstants.DEFAULT_SO_TIMEOUT;
-
+    
+    protected static final String PROTOCOL_HTTP = "http";
+    protected static final String PROTOCOL_HTTPS = "https";
+    
     /**
      * proxydiscription
      */
@@ -304,8 +307,14 @@
         boolean isAuthenticationEnabled = isAuthenticationEnabled(msgCtx);
         int port = targetURL.getPort();
 
+        String protocal = targetURL.getProtocol();
         if (port == -1) {
-            port = 80;
+            if (PROTOCOL_HTTP.equals(protocal)) {
+                port = 80;
+            } else if (PROTOCOL_HTTPS.equals(protocal)){
+                port = 443;                
+            }
+            
         }
 
         // to see the host is a proxy and in the proxy list - available in axis2.xml



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