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 2006/01/25 10:02:16 UTC

svn commit: r372164 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/context/ core/src/org/apache/axis2/deployment/ core/src/org/apache/axis2/description/ saaj/

Author: deepal
Date: Wed Jan 25 01:01:53 2006
New Revision: 372164

URL: http://svn.apache.org/viewcvs?rev=372164&view=rev
Log:
- change to copy refernce parameters in OutOnlyAxisOperation
- improved parameter searching 
- added dependency to saaj/project.xml
- Started doing targetNameSpace handling in AxisService

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisDescription.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
    webservices/axis2/trunk/java/modules/saaj/project.xml

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/context/MessageContext.java Wed Jan 25 01:01:53 2006
@@ -404,42 +404,25 @@
 
         if (getAxisOperation() != null) {
             AxisOperation opDesc = getAxisOperation();
-
-            param = opDesc.getParameter(key);
-
-            if (param != null) {
-                return param;
-            }
+            return opDesc.getParameter(key);
         }
 
         if (getAxisService() != null) {
             AxisService axisService = getAxisService();
-
-            param = axisService.getParameter(key);
-
-            if (param != null) {
-                return param;
-            }
+            return axisService.getParameter(key);
         }
 
         if (getAxisServiceGroup() != null) {
             AxisServiceGroup axisServiceDesc = getAxisServiceGroup();
-
-            param = axisServiceDesc.getParameter(key);
-
-            if (param != null) {
-                return param;
-            }
+            return axisServiceDesc.getParameter(key);
         }
 
         if (configurationContext != null) {
             AxisConfiguration baseConfig = configurationContext
                     .getAxisConfiguration();
-
-            param = baseConfig.getParameter(key);
+            return  baseConfig.getParameter(key);
         }
-
-        return param;
+        return null;
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentConstants.java Wed Jan 25 01:01:53 2006
@@ -71,6 +71,7 @@
 
     // for parameters
     String ATTRIBUTE_NAME = "name";
+    String TARGET_NAME_SPACE = "targetNamespace";
     String ATTRIBUTE_DEFAULT_VERSION = "version";
     String ATTRIBUTE_SCOPE = "scope";
     String ATTRIBUTE_LOCKED = "locked";

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java Wed Jan 25 01:01:53 2006
@@ -97,20 +97,31 @@
                 }
             }
 
+            OMAttribute targetNameSpace = service_element.getAttribute(new QName(TARGET_NAME_SPACE));
+            if(targetNameSpace!=null){
+               String nameSpeceVale=  targetNameSpace.getAttributeValue();
+            }
+
+
             // setting the PolicyInclude
 
             // processing <wsp:Policy> .. </..> elements
-            Iterator policyElements = service_element.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY));
+            Iterator policyElements = service_element.getChildrenWithName(
+                    new QName(POLICY_NS_URI, TAG_POLICY));
 
             if (policyElements != null) {
-                processPolicyElements(PolicyInclude.AXIS_SERVICE_POLICY, policyElements, service.getPolicyInclude());
+                processPolicyElements(
+                        PolicyInclude.AXIS_SERVICE_POLICY, policyElements,
+                        service.getPolicyInclude());
             }
 
             // processing <wsp:PolicyReference> .. </..> elements
-            Iterator policyRefElements = service_element.getChildrenWithName(new QName(POLICY_NS_URI, TAG_POLICY_REF));
+            Iterator policyRefElements = service_element.getChildrenWithName(
+                    new QName(POLICY_NS_URI, TAG_POLICY_REF));
 
             if (policyRefElements != null) {
-                processPolicyRefElements(PolicyInclude.AXIS_SERVICE_POLICY, policyRefElements, service.getPolicyInclude());
+                processPolicyRefElements(PolicyInclude.AXIS_SERVICE_POLICY,
+                        policyRefElements, service.getPolicyInclude());
             }
 
             //processin Service Scop

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisDescription.java?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisDescription.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisDescription.java Wed Jan 25 01:01:53 2006
@@ -16,14 +16,14 @@
 
     private PolicyInclude policyInclude;
 
-	private HashMap children;
-	
+    private HashMap children;
+
     public AxisDescription() {
-		parameterInclude = new ParameterIncludeImpl();
-		policyInclude = new PolicyInclude(this);
-		children = new HashMap();
-	}
-    
+        parameterInclude = new ParameterIncludeImpl();
+        policyInclude = new PolicyInclude(this);
+        children = new HashMap();
+    }
+
     public void addParameter(Parameter param) throws AxisFault {
 
         if (param == null) {
@@ -46,7 +46,12 @@
     }
 
     public Parameter getParameter(String name) {
-        return parameterInclude.getParameter(name);
+        Parameter parameter = parameterInclude.getParameter(name);
+        if (parameter == null && parent != null) {
+            return parent.getParameter(name);
+        } else {
+            return parameter;
+        }
     }
 
     public ArrayList getParameters() {
@@ -64,9 +69,9 @@
     }
 
 
-	public void setParent(AxisDescription parent) {
-		this.parent = parent;
-	}
+    public void setParent(AxisDescription parent) {
+        this.parent = parent;
+    }
 
     public AxisDescription getParent() {
         return parent;
@@ -81,12 +86,12 @@
     }
 
     public void addChild(AxisDescription child) {
-		children.put(child.getKey(), child);
-	}
-    
-	public void addChild(Object key, AxisDescription child) {
-		children.put(key, child);
-	}
+        children.put(child.getKey(), child);
+    }
+
+    public void addChild(Object key, AxisDescription child) {
+        children.put(key, child);
+    }
 
     public Iterator getChildren() {
         return children.values().iterator();
@@ -95,10 +100,10 @@
     public AxisDescription getChild(Object key) {
         return (AxisDescription) children.get(key);
     }
-	
-	public void removeChild(Object key) {
-		children.remove(key);
-	}
+
+    public void removeChild(Object key) {
+        children.remove(key);
+    }
 
     public abstract Object getKey();
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java Wed Jan 25 01:01:53 2006
@@ -25,6 +25,7 @@
 import org.apache.axis2.engine.MessageReceiver;
 import org.apache.axis2.modules.Module;
 import org.apache.axis2.util.PolicyUtil;
+import org.apache.axis2.wsdl.java2wsdl.SchemaGenerator;
 import org.apache.axis2.wsdl.writer.WOMWriter;
 import org.apache.axis2.wsdl.writer.WOMWriterFactory;
 import org.apache.commons.logging.Log;
@@ -86,6 +87,15 @@
     //to keep the status of the service , since service can stop at the run time
     private boolean active = true;
 
+    //to keep the service target name space
+    private QName targetNamespace = new QName(SchemaGenerator.TARGET_NAMESPACE,
+            "targetNamespace",
+            SchemaGenerator.TARGET_NAMESPACE_PREFIX);
+    // to store the target namespace for the schema
+    private QName schematargetNamespace = new QName(SchemaGenerator.SCHEMA_TARGET_NAMESPACE,
+            "schematargetNamespace",
+            SchemaGenerator.SCHEMA_NAMESPACE_PRFIX);
+
     /**
      * Constructor AxisService.
      */
@@ -605,5 +615,21 @@
 
     public void setActive(boolean active) {
         this.active = active;
+    }
+
+    public QName getSchematargetNamespace() {
+        return schematargetNamespace;
+    }
+
+    public void setSchematargetNamespace(QName schematargetNamespace) {
+        this.schematargetNamespace = schematargetNamespace;
+    }
+
+    public QName getTargetNamespace() {
+        return targetNamespace;
+    }
+
+    public void setTargetNamespace(QName targetNamespace) {
+        this.targetNamespace = targetNamespace;
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/OutOnlyAxisOperation.java Wed Jan 25 01:01:53 2006
@@ -1,6 +1,9 @@
 package org.apache.axis2.description;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.axis2.soap.SOAPHeader;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.client.ListenerManager;
 import org.apache.axis2.client.OperationClient;
@@ -16,6 +19,8 @@
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
+import java.util.Map;
+import java.util.Iterator;
 
 public class OutOnlyAxisOperation extends AxisOperation {
     private AxisMessage inFaultMessage;
@@ -148,7 +153,7 @@
                                Options options) {
         this.axisOp = axisOp;
         this.sc = sc;
-        this.options = new Options(options);
+        this.options = options;
         this.completed = false;
         oc = new OperationContext(axisOp, sc);
     }
@@ -249,6 +254,23 @@
         mc.setMessageID(messageId);
     }
 
+    private void addReferenceParameters(SOAPEnvelope env) {
+        if (options.isManageSession()) {
+            EndpointReference tepr = sc.getTargetEPR();
+            if (tepr != null) {
+                Map map = tepr.getAllReferenceParameters();
+                Iterator valuse = map.values().iterator();
+                SOAPHeader sh = env.getHeader();
+                while (valuse.hasNext()) {
+                    Object refparaelement = valuse.next();
+                    if (refparaelement instanceof OMElement) {
+                        sh.addChild((OMElement) refparaelement);
+                    }
+                }
+            }
+        }
+    }
+
 
     /**
      * Executes the MEP. What this does depends on the specific MEP client. The
@@ -294,6 +316,7 @@
         // create the operation context for myself
         OperationContext oc = new OperationContext(axisOp, sc);
         oc.addMessageContext(mc);
+        addReferenceParameters(mc.getEnvelope());
         // ship it out
         AxisEngine engine = new AxisEngine(cc);
         engine.send(mc);

Modified: webservices/axis2/trunk/java/modules/saaj/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/project.xml?rev=372164&r1=372163&r2=372164&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/project.xml (original)
+++ webservices/axis2/trunk/java/modules/saaj/project.xml Wed Jan 25 01:01:53 2006
@@ -216,6 +216,11 @@
                 <module>true</module>
             </properties>
         </dependency>
+         <dependency>
+            <groupId>ws-commons</groupId>
+            <artifactId>XmlSchema</artifactId>
+            <version>${XmlSchema.version}</version>
+        </dependency>
         <dependency>
             <groupId>axis</groupId>
             <artifactId>axis-wsdl4j</artifactId>