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 de...@apache.org on 2005/05/10 10:38:15 UTC

svn commit: r169442 - in /webservices/axis/trunk/java/modules: addressing/ addressing/src/ addressing/src/META-INF/ addressing/src/org/ addressing/src/org/apache/ addressing/src/org/apache/axis/ addressing/src/org/apache/axis/handlers/ core/samples/deployment/module2/ core/samples/deployment/module2/META-INF/ core/samples/deployment/module2/org/apache/axis/ core/samples/deployment/module2/org/apache/axis/handlers/ core/samples/deployment/module2/org/apache/module/ core/samples/deployment/service2/META-INF/ core/src/org/apache/axis/deployment/ core/src/org/apache/axis/engine/ core/test/org/apache/axis/engine/

Author: deepal
Date: Tue May 10 01:38:13 2005
New Revision: 169442

URL: http://svn.apache.org/viewcvs?rev=169442&view=rev
Log:
Made addressing as a extension module (not fully completed) Two handlers wrote by Chinthka (AddressingInHandler and AddressingOutHnadler) put into inflow and out flow (pre-dispatch phase)

Added:
    webservices/axis/trunk/java/modules/addressing/
    webservices/axis/trunk/java/modules/addressing/addressing.iml
    webservices/axis/trunk/java/modules/addressing/maven.xml
    webservices/axis/trunk/java/modules/addressing/project.xml
    webservices/axis/trunk/java/modules/addressing/src/
    webservices/axis/trunk/java/modules/addressing/src/META-INF/
    webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml
    webservices/axis/trunk/java/modules/addressing/src/build.xml
    webservices/axis/trunk/java/modules/addressing/src/org/
    webservices/axis/trunk/java/modules/addressing/src/org/apache/
    webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/
    webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/AddressingModule.java
    webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/
    webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingInHandler.java
    webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingOutHandler.java
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/AddressingModule.java
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingInHandler.java
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingOutHandler.java
Removed:
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/Handler4.java
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/META-INF/MANIFEST.MF
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/module/
Modified:
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/META-INF/module.xml
    webservices/axis/trunk/java/modules/core/samples/deployment/module2/build.xml
    webservices/axis/trunk/java/modules/core/samples/deployment/service2/META-INF/service.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java

Added: webservices/axis/trunk/java/modules/addressing/addressing.iml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/addressing.iml?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/addressing.iml (added)
+++ webservices/axis/trunk/java/modules/addressing/addressing.iml Tue May 10 01:38:13 2005
@@ -0,0 +1,254 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module version="4" relativePaths="true" type="JAVA_MODULE">
+  <component name="ModuleRootManager" />
+  <component name="NewModuleRootManager">
+    <output url="file://$MODULE_DIR$/classes" />
+    <exclude-output />
+    <exclude-exploded />
+    <content url="file://$MODULE_DIR$">
+      <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
+    </content>
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+    <orderEntry type="module" module-name="axis2-core" />
+    <orderEntry type="module" module-name="axis2-wsdl" />
+    <orderEntry type="module" module-name="axis2-xml" />
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-logging/jars/commons-logging-1.0.3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-io/jars/commons-io-20030203.000550.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-jelly/jars/commons-jelly-20030902.160215.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-jelly/jars/commons-jelly-tags-log-20030211.142821.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-lang/jars/commons-lang-2.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-httpclient/jars/commons-httpclient-2.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-jelly/jars/commons-jelly-tags-jsl-20030211.143151.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-jelly/jars/commons-jelly-tags-velocity-20030303.205659.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-jelly/jars/commons-jelly-tags-xml-20040613.030723.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-fileupload/jars/commons-fileupload-1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-jelly/jars/commons-jelly-tags-antlr-20030211.143720.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/log4j/jars/log4j-1.2.8.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/dom4j/jars/dom4j-1.4-dev-8.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/xml-apis/jars/xml-apis-1.0.b2.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/james/jars/james-3.0a1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/xerces/jars/xerces-2.4.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/thaiopensource/jars/jing-20030619.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/velocity-dvsl/jars/velocity-dvsl-0.45.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-net/jars/commons-net-1.1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/commons-net/jars/commons-net-1.3.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/isorelax/jars/isorelax-20030108.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/jsch/jars/jsch-0.1.5.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/axis/jars/axis-wsdl4j-1.2-RC3.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/axis/jars/axis-wsdl4j-1.2-RC1.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/stax/jars/stax-1.1.1-dev.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="module-library">
+      <library>
+        <CLASSES>
+          <root url="jar://C:/Documents and Settings/me/.maven/repository/stax/jars/stax-api-1.0.jar!/" />
+        </CLASSES>
+        <JAVADOC />
+        <SOURCES />
+      </library>
+    </orderEntry>
+    <orderEntry type="library" name="junit" level="application" />
+    <orderEntryProperties />
+  </component>
+</module>
+

Added: webservices/axis/trunk/java/modules/addressing/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/maven.xml?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/maven.xml (added)
+++ webservices/axis/trunk/java/modules/addressing/maven.xml Tue May 10 01:38:13 2005
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Revision: 1.21 $ $Date: 2004-10-27 20:54:09 +0600 (Wed, 27 Oct 2004) $ -->
+
+<project default="jar"
+    xmlns:j="jelly:core"
+    xmlns:maven="jelly:maven"
+    xmlns:deploy="deploy"
+    xmlns:ant="jelly:ant">
+    <postGoal name="test:compile">
+        <j:jelly xmlns="jelly:ant">
+            <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src"/>
+	  </j:jelly>
+     </postGoal> 
+ </project>

Added: webservices/axis/trunk/java/modules/addressing/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/project.xml?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/project.xml (added)
+++ webservices/axis/trunk/java/modules/addressing/project.xml Tue May 10 01:38:13 2005
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<project>
+    <pomVersion>3</pomVersion>
+    <extend>../../etc/project.xml</extend>
+
+    <id>addressing</id>
+    <name>addressing</name>
+    <description>Total addressing implementation</description>
+
+    <dependencies>
+        <dependency>
+            <groupId>axis</groupId>
+            <artifactId>axis2-xml</artifactId>
+            <version>${pom.currentVersion}</version>
+        </dependency>  
+        <!-- external JARs -->
+        <dependency>
+            <groupId>commons-logging</groupId>
+            <artifactId>commons-logging</artifactId>
+            <version>1.0.3</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+	<dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax</artifactId>
+            <version>1.1.1-dev</version>
+            <properties>
+                <module>true</module>
+            </properties>
+		<url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+	<dependency>
+            <groupId>log4j</groupId>
+            <artifactId>log4j</artifactId>
+            <version>1.2.8</version>
+            <properties>
+                <module>true</module>
+            </properties>
+		<url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+
+	<dependency>
+            <groupId>stax</groupId>
+            <artifactId>stax-api</artifactId>
+            <version>1.0</version>
+            <properties>
+                <module>true</module>
+            </properties>
+		<url>http://dist.codehaus.org/stax/jars/</url>
+        </dependency>
+	<dependency>
+            <groupId>james</groupId>
+            <artifactId>james</artifactId>
+            <version>3.0a1</version>
+            <properties>
+                <module>true</module>
+            </properties>
+        </dependency>
+	 <dependency>
+           <groupId>commons-net</groupId>
+           <artifactId>commons-net</artifactId>
+           <version>1.3.0</version>
+           <properties>
+               <module>true</module>
+           </properties>
+       </dependency>
+	</dependencies>
+</project>

Added: webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml (added)
+++ webservices/axis/trunk/java/modules/addressing/src/META-INF/module.xml Tue May 10 01:38:13 2005
@@ -0,0 +1,25 @@
+<module name="addressing" class="org.apache.axis.AddressingModule">
+    <inflow>
+        <handler name="AddressingInHandler" class="org.apache.axis.handlers.AddressingInHandler">
+            <order phase="pre-dispatch"/>
+        </handler>
+    </inflow>
+
+    <outflow>
+        <handler name="AddressingOutHandler" class="org.apache.axis.handlers.AddressingOutHandler">
+            <order phase="pre-dispatch"/>
+        </handler>
+    </outflow>
+
+    <Outfaultflow>
+        <handler name="Fault_AddressingOutHandler" class="org.apache.axis.handlers.AddressingOutHandler">
+            <order phase="pre-dispatch"/>
+        </handler>
+    </Outfaultflow>
+
+    <INfaultflow>
+        <handler name="Fault_AddressingInHandler" class="org.apache.axis.handlers.AddressingInHandler">
+            <order phase="pre-dispatch"/>
+        </handler>
+    </INfaultflow>
+</module>
\ No newline at end of file

Added: webservices/axis/trunk/java/modules/addressing/src/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/src/build.xml?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/src/build.xml (added)
+++ webservices/axis/trunk/java/modules/addressing/src/build.xml Tue May 10 01:38:13 2005
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<project basedir="." default="jar">
+	<property name="src" location="."/>
+	<property name="build" location="build"/>
+	<property name="build.classes" location="${build}/classes"/>
+	<property name="build.lib" location="${build}/lib"/>
+	<property name="lib" location="lib"/>
+	<property name="root" location="../../../"/>
+	<property name="jar.dir" location="${root}/target/addressing"/>
+	
+	<path id="axis.test.classpath">
+		<path refid="maven.dependency.classpath"></path>
+		<pathelement location="../../../target/classes"/>
+	</path>
+	
+	<target name="compile" depends="init" unless="jars.uptodate">
+	   <mkdir dir="${build.classes}"/>
+	   <mkdir dir="${build.lib}"/>
+		<javac destdir="${build.classes}" debug="on">
+			<classpath refid="axis.test.classpath" />
+			<src path="${src}"/>
+		</javac>
+	</target>
+	
+	<target name="jar" depends="compile" unless="jars.uptodate">
+       <copy todir="${build.classes}/META-INF">
+			<fileset dir="${basedir}/META-INF/">
+			<include name="**/*.xml"/>
+			<exclude name="build.xml"/>
+			</fileset>
+		</copy>
+
+		<mkdir dir="${jar.dir}"/>
+		<jar jarfile="${jar.dir}/module1.jar" basedir="${build.classes}" >
+			<include name="**" />
+		</jar>
+		<delete dir="${build}"/>
+	</target>
+	
+	<target name="init">
+		<uptodate property="jars.uptodate" targetfile="${jar.dir}/addressing.jar">
+			<srcfiles dir="${src}">
+				<include name="**/*.java"/>
+				<include name="**/*.xml"/>
+				<include name="**/*.wsdl"/>
+				<exclude name="${build}/**"/>
+			</srcfiles>
+		</uptodate>
+		<echo message="the files are up to date = ${jars.uptodate}"></echo>
+	</target>
+	
+</project>

Added: webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/AddressingModule.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/AddressingModule.java?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/AddressingModule.java (added)
+++ webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/AddressingModule.java Tue May 10 01:38:13 2005
@@ -0,0 +1,43 @@
+package org.apache.axis;
+
+import org.apache.axis.modules.Module;
+import org.apache.axis.context.SystemContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.ExecutionChain;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: May 10, 2005
+ * Time: 12:06:59 PM
+ */
+public class AddressingModule implements Module{
+    public void init(SystemContext moduleContext) throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void engage(ExecutionChain exeChain) throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void shutDown() throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingInHandler.java?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingInHandler.java (added)
+++ webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingInHandler.java Tue May 10 01:38:13 2005
@@ -0,0 +1,135 @@
+package org.apache.axis.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.addressing.MessageInformationHeadersCollection;
+import org.apache.axis.addressing.miheaders.RelatesTo;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMAttribute;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.SOAPHeader;
+import org.apache.axis.om.SOAPHeaderBlock;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: May 10, 2005
+ * Time: 11:53:20 AM
+ */
+public class AddressingInHandler extends AbstractHandler {
+    /**
+     * Eran Chinthaka (chinthaka@apache.org) Date : 03-04-2005 Time : 14:42
+     */
+
+    // this parameter has to be set by the module deployer.
+    private boolean isAddressingOptional = true;
+
+    private Log logger = LogFactory.getLog(getClass());
+
+
+    public void invoke(MessageContext msgContext) throws AxisFault {
+        logger.debug("Starting Addressing IN Handler .........");
+        SOAPHeader header = msgContext.getEnvelope().getHeader();
+        if(header == null){
+            return;
+        }
+
+        ArrayList addressingHeaders = header.getHeaderBolcksWithNSURI(AddressingConstants.WSA_NAMESPACE);
+        if (addressingHeaders != null) {
+            extractAddressingInformationFromHeaders(header, msgContext.getMessageInformationHeaders(),addressingHeaders);
+        } else {
+            // no addressing headers present
+            if(!isAddressingOptional){
+                throw new AxisFault("Addressing Handlers should present, but doesn't present in the incoming message !!");
+            }
+            logger.debug("No Addressing Headers present in the IN message. Addressing In Handler does nothing.");
+        }
+    }
+
+    protected MessageInformationHeadersCollection extractAddressingInformationFromHeaders(SOAPHeader header, MessageInformationHeadersCollection messageInformationHeadersCollection,ArrayList addressingHeaders) {
+        if(messageInformationHeadersCollection == null){
+             messageInformationHeadersCollection = new MessageInformationHeadersCollection();
+        }
+
+        Iterator addressingHeadersIt = addressingHeaders.iterator();
+        while (addressingHeadersIt.hasNext()) {
+            SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeadersIt.next();
+            EndpointReference epr = null;
+            if (AddressingConstants.WSA_TO.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getTo();
+                if(epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_TO, "");
+                    messageInformationHeadersCollection.setTo(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_FROM.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getFrom();
+                if(epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_FROM, "");
+                    messageInformationHeadersCollection.setFrom(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_REPLY_TO.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getReplyTo();
+                if( epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_REPLY_TO, "");
+                    messageInformationHeadersCollection.setReplyTo(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_FAULT_TO.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getFaultTo();
+                if( epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_FAULT_TO, "");
+                    messageInformationHeadersCollection.setTo(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_MESSAGE_ID.equals(soapHeaderBlock.getLocalName())) {
+                messageInformationHeadersCollection.setMessageId(soapHeaderBlock.getText());
+            } else if (AddressingConstants.WSA_ACTION.equals(soapHeaderBlock.getLocalName())) {
+                messageInformationHeadersCollection.setAction(soapHeaderBlock.getText());
+            } else if (AddressingConstants.WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName())) {
+                String address = soapHeaderBlock.getText();
+                OMAttribute relationshipType = soapHeaderBlock.getFirstAttribute(new QName(AddressingConstants.WSA_NAMESPACE, AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
+                RelatesTo relatesTo = new RelatesTo(address, relationshipType == null ? "wsa:Reply" : relationshipType.getValue());
+                messageInformationHeadersCollection.setRelatesTo(relatesTo);
+            }
+        }
+
+        return messageInformationHeadersCollection;
+    }
+
+
+    private void extractEPRInformation(SOAPHeaderBlock headerBlock, EndpointReference epr) {
+        OMElement address =  headerBlock.getFirstChildWithName(new QName(AddressingConstants.WSA_NAMESPACE, AddressingConstants.EPR_ADDRESS));
+        if (address != null) {
+            epr.setAddress(address.getText());
+        }
+
+
+    }
+}
+

Added: webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingOutHandler.java?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingOutHandler.java (added)
+++ webservices/axis/trunk/java/modules/addressing/src/org/apache/axis/handlers/AddressingOutHandler.java Tue May 10 01:38:13 2005
@@ -0,0 +1,223 @@
+package org.apache.axis.handlers;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.AnyContentType;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.addressing.MessageInformationHeadersCollection;
+import org.apache.axis.addressing.ServiceName;
+import org.apache.axis.addressing.miheaders.RelatesTo;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.handlers.AbstractHandler;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.SOAPHeader;
+import org.apache.axis.om.SOAPHeaderBlock;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: May 10, 2005
+ * Time: 12:03:17 PM
+ */
+
+public class AddressingOutHandler
+        extends AbstractHandler
+        implements AddressingConstants {
+
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+    private boolean isAddressingEnabled = true;
+
+    // IN message, if any, has messageId and replyTo and faultTo addresses that needs to be used
+    // in the OUT message. User may sometimes override these values, at his discretion .The following
+    // boolean variable will create room for that.
+    private boolean overrideINMessageInformation = false;
+
+    OMNamespace addressingNamespace =
+            OMAbstractFactory.getSOAP11Factory().createOMNamespace(WSA_NAMESPACE, "wsa");
+
+    public void invoke(MessageContext msgContext) throws AxisFault {
+
+        if (!isAddressingEnabled) {
+            return;
+        }
+
+        MessageContext lastInMessageContext = msgContext.getOperationContext().getLastInMessageContext();
+
+
+        MessageInformationHeadersCollection messageInformationHeaders =
+                msgContext.getMessageInformationHeaders();
+        SOAPHeader soapHeader = msgContext.getEnvelope().getHeader();
+
+
+        EndpointReference epr = messageInformationHeaders.getTo();
+        if (epr != null && (lastInMessageContext == null || overrideINMessageInformation)) {
+            addToSOAPHeader(epr, AddressingConstants.WSA_TO, soapHeader);
+        } else if (lastInMessageContext != null) {
+            if (!msgContext.getEnvelope().getBody().hasFault()) {
+                setINReplyToAsOUTTo(lastInMessageContext, soapHeader);
+            } else {
+                setINFaultToAsOUTTo(lastInMessageContext, soapHeader);
+            }
+        }
+
+        String action = messageInformationHeaders.getAction();
+        if (action != null) {
+            processStringInfo(action, WSA_ACTION, soapHeader);
+        }
+
+        epr = messageInformationHeaders.getReplyTo();
+        if (epr != null) {//optional
+            addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, soapHeader);
+        }
+
+        epr = messageInformationHeaders.getFrom();
+        if (epr != null) {//optional
+            addToSOAPHeader(epr, AddressingConstants.WSA_FROM, soapHeader);
+        }
+        epr = messageInformationHeaders.getFaultTo();
+        if (epr != null) {//optional
+            addToSOAPHeader(epr, AddressingConstants.WSA_FAULT_TO, soapHeader);
+        }
+
+        String messageID = messageInformationHeaders.getMessageId();
+        if (messageID != null) {//optional
+            processStringInfo(messageID, WSA_MESSAGE_ID, soapHeader);
+        }
+
+        RelatesTo relatesTo = messageInformationHeaders.getRelatesTo();
+        OMElement relatesToHeader = null;
+
+        if (!overrideINMessageInformation && lastInMessageContext != null && "".equals(lastInMessageContext.getMessageID())) {
+            relatesToHeader = processStringInfo(lastInMessageContext.getMessageID(), WSA_RELATES_TO, soapHeader);
+        } else if (relatesTo != null) {
+            relatesToHeader = processStringInfo(relatesTo.getValue(), WSA_RELATES_TO, soapHeader);
+        }
+
+        if (relatesToHeader != null)
+            if ("".equals(relatesTo.getRelationshipType())) {
+                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
+                        WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE,
+                        addressingNamespace);
+            } else {
+                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
+                        relatesTo.getRelationshipType(),
+                        addressingNamespace);
+            }
+    }
+
+
+    private void setINFaultToAsOUTTo(MessageContext lastInMessageContext, SOAPHeader soapHeader) {
+        EndpointReference lastInFaultTo = lastInMessageContext.getFaultTo();
+        if (lastInFaultTo != null) {
+            addToSOAPHeader(lastInFaultTo, AddressingConstants.WSA_TO, soapHeader);
+        } else {
+            setINReplyToAsOUTTo(lastInMessageContext, soapHeader);
+        }
+    }
+
+    private void setINReplyToAsOUTTo(MessageContext lastInMessageContext, SOAPHeader soapHeader) {
+        EndpointReference lastInReplyTo = lastInMessageContext.getReplyTo();
+        if (lastInReplyTo != null) {
+            addToSOAPHeader(lastInReplyTo, AddressingConstants.WSA_TO, soapHeader);
+        }
+    }
+
+    private OMElement processStringInfo(String value,
+                                        String type,
+                                        SOAPHeader soapHeader) {
+        if (!"".equals(value) && value != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(type, addressingNamespace);
+            soapHeaderBlock.addChild(OMAbstractFactory.getSOAP11Factory().createText(value));
+            return soapHeaderBlock;
+        }
+        return null;
+    }
+
+    protected void addToSOAPHeader(EndpointReference epr,
+                                   String type,
+                                   SOAPHeader soapHeader) {
+        if (epr == null) {
+            return;
+        }
+        String address = epr.getAddress();
+        if (!"".equals(address) && address != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(type, addressingNamespace);
+            OMElement addressElement =
+                    OMAbstractFactory.getSOAP11Factory().createOMElement(EPR_ADDRESS,
+                            addressingNamespace);
+            soapHeaderBlock.addChild(addressElement);
+            addressElement.setText(address);
+
+        }
+
+        QName portType = epr.getPortType();
+        if (portType != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(EPR_PORT_TYPE, addressingNamespace);
+            soapHeaderBlock.addChild(OMAbstractFactory.getSOAP11Factory().createText(portType.getPrefix() + ":" + portType.getLocalPart()));
+        }
+
+        ServiceName serviceName = epr.getServiceName();
+        if (serviceName != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(EPR_SERVICE_NAME,
+                            addressingNamespace);
+            soapHeaderBlock.addAttribute(EPR_SERVICE_NAME_PORT_NAME,
+                    serviceName.getPortName(),
+                    addressingNamespace);
+            soapHeaderBlock.addChild(OMAbstractFactory.getSOAP11Factory().createText(serviceName.getName().getPrefix()
+                    + ":"
+                    + serviceName.getName().getLocalPart()));
+        }
+
+        AnyContentType referenceParameters = epr.getReferenceParameters();
+        processAnyContentType(referenceParameters, soapHeader);
+
+        AnyContentType referenceProperties = epr.getReferenceProperties();
+        processAnyContentType(referenceProperties, soapHeader);
+
+    }
+
+    private void processAnyContentType(AnyContentType referenceParameters,
+                                       SOAPHeader soapHeader) {
+        if (referenceParameters != null) {
+            Iterator iterator = referenceParameters.getKeys();
+            while (iterator.hasNext()) {
+                QName key = (QName) iterator.next();
+                String value = referenceParameters.getReferenceValue(key);
+                OMElement omElement =
+                        OMAbstractFactory.getSOAP11Factory().createOMElement(key, soapHeader);
+                soapHeader.addChild(omElement);
+                omElement.addChild(OMAbstractFactory.getSOAP11Factory().createText(value));
+            }
+        }
+    }
+}
+

Modified: webservices/axis/trunk/java/modules/core/samples/deployment/module2/META-INF/module.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/module2/META-INF/module.xml?rev=169442&r1=169441&r2=169442&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/module2/META-INF/module.xml (original)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/module2/META-INF/module.xml Tue May 10 01:38:13 2005
@@ -1,29 +1,25 @@
-<module name="module2" class="org.apache.module.Module2Impl">
+<module name="addressing" class="org.apache.axis.AddressingModule">
     <inflow>
-        <handler name="h1" class="org.apache.axis.registry.Handler4">
-            <order phase="global" />
-        </handler>
-        <handler name="h2" class="org.apache.axis.registry.Handler4">
-             <order phase="service"/>
+        <handler name="AddressingInHandler" class="org.apache.axis.handlers.AddressingInHandler">
+            <order phase="pre-dispatch"/>
         </handler>
     </inflow>
 
     <outflow>
-        <handler name="h3" class="org.apache.axis.registry.Handler4">
-            <order phase="global"/>
+        <handler name="AddressingOutHandler" class="org.apache.axis.handlers.AddressingOutHandler">
+            <order phase="pre-dispatch"/>
         </handler>
     </outflow>
 
     <Outfaultflow>
-        <handler name="h4" class="org.apache.axis.registry.Handler4">
-             <order phase="service"/>
+        <handler name="Fault_AddressingOutHandler" class="org.apache.axis.handlers.AddressingOutHandler">
+            <order phase="pre-dispatch"/>
         </handler>
     </Outfaultflow>
 
     <INfaultflow>
-        <handler name="h5" class="org.apache.axis.registry.Handler4">
-             <order phase="service"/>
+        <handler name="Fault_AddressingInHandler" class="org.apache.axis.handlers.AddressingInHandler">
+            <order phase="pre-dispatch"/>
         </handler>
     </INfaultflow>
-
 </module>

Modified: webservices/axis/trunk/java/modules/core/samples/deployment/module2/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/module2/build.xml?rev=169442&r1=169441&r2=169442&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/module2/build.xml (original)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/module2/build.xml Tue May 10 01:38:13 2005
@@ -31,14 +31,14 @@
 		</copy>
 
 		<mkdir dir="${jar.dir}"/>
-		<jar jarfile="${jar.dir}/module2.jar" basedir="${build.classes}" >
+		<jar jarfile="${jar.dir}/addressing.jar" basedir="${build.classes}" >
 			<include name="**" />
 		</jar>
 		<delete dir="${build}"/>
 	</target>
 	
 	<target name="init">
-		<uptodate property="jars.uptodate" targetfile="${jar.dir}/module2.jar">
+		<uptodate property="jars.uptodate" targetfile="${jar.dir}/addressing.jar">
 			<srcfiles dir="${src}">
 				<include name="**/*.java"/>
 				<include name="**/*.xml"/>

Added: webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/AddressingModule.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/AddressingModule.java?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/AddressingModule.java (added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/AddressingModule.java Tue May 10 01:38:13 2005
@@ -0,0 +1,43 @@
+package org.apache.axis;
+
+import org.apache.axis.modules.Module;
+import org.apache.axis.context.SystemContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.ExecutionChain;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * 
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: May 10, 2005
+ * Time: 2:18:53 PM
+ */
+public class AddressingModule implements Module{
+    public void init(SystemContext moduleContext) throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void engage(ExecutionChain exeChain) throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public void shutDown() throws AxisFault {
+        //To change body of implemented methods use File | Settings | File Templates.
+    }
+}

Added: webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingInHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingInHandler.java?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingInHandler.java (added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingInHandler.java Tue May 10 01:38:13 2005
@@ -0,0 +1,135 @@
+package org.apache.axis.handlers;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.addressing.MessageInformationHeadersCollection;
+import org.apache.axis.addressing.miheaders.RelatesTo;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMAttribute;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.SOAPHeader;
+import org.apache.axis.om.SOAPHeaderBlock;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: May 10, 2005
+ * Time: 11:53:20 AM
+ */
+public class AddressingInHandler extends AbstractHandler {
+    /**
+     * Eran Chinthaka (chinthaka@apache.org) Date : 03-04-2005 Time : 14:42
+     */
+
+    // this parameter has to be set by the module deployer.
+    private boolean isAddressingOptional = true;
+
+    private Log logger = LogFactory.getLog(getClass());
+
+
+    public void invoke(MessageContext msgContext) throws AxisFault {
+        logger.debug("Starting Addressing IN Handler .........");
+        SOAPHeader header = msgContext.getEnvelope().getHeader();
+        if(header == null){
+            return;
+        }
+
+        ArrayList addressingHeaders = header.getHeaderBolcksWithNSURI(AddressingConstants.WSA_NAMESPACE);
+        if (addressingHeaders != null) {
+            extractAddressingInformationFromHeaders(header, msgContext.getMessageInformationHeaders(),addressingHeaders);
+        } else {
+            // no addressing headers present
+            if(!isAddressingOptional){
+                throw new AxisFault("Addressing Handlers should present, but doesn't present in the incoming message !!");
+            }
+            logger.debug("No Addressing Headers present in the IN message. Addressing In Handler does nothing.");
+        }
+    }
+
+    protected MessageInformationHeadersCollection extractAddressingInformationFromHeaders(SOAPHeader header, MessageInformationHeadersCollection messageInformationHeadersCollection,ArrayList addressingHeaders) {
+        if(messageInformationHeadersCollection == null){
+             messageInformationHeadersCollection = new MessageInformationHeadersCollection();
+        }
+
+        Iterator addressingHeadersIt = addressingHeaders.iterator();
+        while (addressingHeadersIt.hasNext()) {
+            SOAPHeaderBlock soapHeaderBlock = (SOAPHeaderBlock) addressingHeadersIt.next();
+            EndpointReference epr = null;
+            if (AddressingConstants.WSA_TO.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getTo();
+                if(epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_TO, "");
+                    messageInformationHeadersCollection.setTo(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_FROM.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getFrom();
+                if(epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_FROM, "");
+                    messageInformationHeadersCollection.setFrom(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_REPLY_TO.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getReplyTo();
+                if( epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_REPLY_TO, "");
+                    messageInformationHeadersCollection.setReplyTo(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_FAULT_TO.equals(soapHeaderBlock.getLocalName())) {
+                epr = messageInformationHeadersCollection.getFaultTo();
+                if( epr == null){
+                    epr = new EndpointReference(AddressingConstants.WSA_FAULT_TO, "");
+                    messageInformationHeadersCollection.setTo(epr);
+                }
+                extractEPRInformation(soapHeaderBlock, epr);
+            } else if (AddressingConstants.WSA_MESSAGE_ID.equals(soapHeaderBlock.getLocalName())) {
+                messageInformationHeadersCollection.setMessageId(soapHeaderBlock.getText());
+            } else if (AddressingConstants.WSA_ACTION.equals(soapHeaderBlock.getLocalName())) {
+                messageInformationHeadersCollection.setAction(soapHeaderBlock.getText());
+            } else if (AddressingConstants.WSA_RELATES_TO.equals(soapHeaderBlock.getLocalName())) {
+                String address = soapHeaderBlock.getText();
+                OMAttribute relationshipType = soapHeaderBlock.getFirstAttribute(new QName(AddressingConstants.WSA_NAMESPACE, AddressingConstants.WSA_RELATES_TO_RELATIONSHIP_TYPE));
+                RelatesTo relatesTo = new RelatesTo(address, relationshipType == null ? "wsa:Reply" : relationshipType.getValue());
+                messageInformationHeadersCollection.setRelatesTo(relatesTo);
+            }
+        }
+
+        return messageInformationHeadersCollection;
+    }
+
+
+    private void extractEPRInformation(SOAPHeaderBlock headerBlock, EndpointReference epr) {
+        OMElement address =  headerBlock.getFirstChildWithName(new QName(AddressingConstants.WSA_NAMESPACE, AddressingConstants.EPR_ADDRESS));
+        if (address != null) {
+            epr.setAddress(address.getText());
+        }
+
+
+    }
+}
+

Added: webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingOutHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingOutHandler.java?rev=169442&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingOutHandler.java (added)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/module2/org/apache/axis/handlers/AddressingOutHandler.java Tue May 10 01:38:13 2005
@@ -0,0 +1,222 @@
+package org.apache.axis.handlers;
+
+import java.util.Iterator;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.AnyContentType;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.addressing.MessageInformationHeadersCollection;
+import org.apache.axis.addressing.ServiceName;
+import org.apache.axis.addressing.miheaders.RelatesTo;
+import org.apache.axis.context.MessageContext;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.SOAPHeader;
+import org.apache.axis.om.SOAPHeaderBlock;
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ *
+ */
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: May 10, 2005
+ * Time: 12:03:17 PM
+ */
+
+public class AddressingOutHandler
+        extends AbstractHandler
+        implements AddressingConstants {
+
+    /**
+     * Eran Chinthaka (chinthaka@apache.org)
+     */
+
+    private boolean isAddressingEnabled = true;
+
+    // IN message, if any, has messageId and replyTo and faultTo addresses that needs to be used
+    // in the OUT message. User may sometimes override these values, at his discretion .The following
+    // boolean variable will create room for that.
+    private boolean overrideINMessageInformation = false;
+
+    OMNamespace addressingNamespace =
+            OMAbstractFactory.getSOAP11Factory().createOMNamespace(WSA_NAMESPACE, "wsa");
+
+    public void invoke(MessageContext msgContext) throws AxisFault {
+
+        if (!isAddressingEnabled) {
+            return;
+        }
+
+        MessageContext lastInMessageContext = msgContext.getOperationContext().getLastInMessageContext();
+
+
+        MessageInformationHeadersCollection messageInformationHeaders =
+                msgContext.getMessageInformationHeaders();
+        SOAPHeader soapHeader = msgContext.getEnvelope().getHeader();
+
+
+        EndpointReference epr = messageInformationHeaders.getTo();
+        if (epr != null && (lastInMessageContext == null || overrideINMessageInformation)) {
+            addToSOAPHeader(epr, AddressingConstants.WSA_TO, soapHeader);
+        } else if (lastInMessageContext != null) {
+            if (!msgContext.getEnvelope().getBody().hasFault()) {
+                setINReplyToAsOUTTo(lastInMessageContext, soapHeader);
+            } else {
+                setINFaultToAsOUTTo(lastInMessageContext, soapHeader);
+            }
+        }
+
+        String action = messageInformationHeaders.getAction();
+        if (action != null) {
+            processStringInfo(action, WSA_ACTION, soapHeader);
+        }
+
+        epr = messageInformationHeaders.getReplyTo();
+        if (epr != null) {//optional
+            addToSOAPHeader(epr, AddressingConstants.WSA_REPLY_TO, soapHeader);
+        }
+
+        epr = messageInformationHeaders.getFrom();
+        if (epr != null) {//optional
+            addToSOAPHeader(epr, AddressingConstants.WSA_FROM, soapHeader);
+        }
+        epr = messageInformationHeaders.getFaultTo();
+        if (epr != null) {//optional
+            addToSOAPHeader(epr, AddressingConstants.WSA_FAULT_TO, soapHeader);
+        }
+
+        String messageID = messageInformationHeaders.getMessageId();
+        if (messageID != null) {//optional
+            processStringInfo(messageID, WSA_MESSAGE_ID, soapHeader);
+        }
+
+        RelatesTo relatesTo = messageInformationHeaders.getRelatesTo();
+        OMElement relatesToHeader = null;
+
+        if (!overrideINMessageInformation && lastInMessageContext != null && "".equals(lastInMessageContext.getMessageID())) {
+            relatesToHeader = processStringInfo(lastInMessageContext.getMessageID(), WSA_RELATES_TO, soapHeader);
+        } else if (relatesTo != null) {
+            relatesToHeader = processStringInfo(relatesTo.getValue(), WSA_RELATES_TO, soapHeader);
+        }
+
+        if (relatesToHeader != null)
+            if ("".equals(relatesTo.getRelationshipType())) {
+                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
+                        WSA_RELATES_TO_RELATIONSHIP_TYPE_DEFAULT_VALUE,
+                        addressingNamespace);
+            } else {
+                relatesToHeader.addAttribute(WSA_RELATES_TO_RELATIONSHIP_TYPE,
+                        relatesTo.getRelationshipType(),
+                        addressingNamespace);
+            }
+    }
+
+
+    private void setINFaultToAsOUTTo(MessageContext lastInMessageContext, SOAPHeader soapHeader) {
+        EndpointReference lastInFaultTo = lastInMessageContext.getFaultTo();
+        if (lastInFaultTo != null) {
+            addToSOAPHeader(lastInFaultTo, AddressingConstants.WSA_TO, soapHeader);
+        } else {
+            setINReplyToAsOUTTo(lastInMessageContext, soapHeader);
+        }
+    }
+
+    private void setINReplyToAsOUTTo(MessageContext lastInMessageContext, SOAPHeader soapHeader) {
+        EndpointReference lastInReplyTo = lastInMessageContext.getReplyTo();
+        if (lastInReplyTo != null) {
+            addToSOAPHeader(lastInReplyTo, AddressingConstants.WSA_TO, soapHeader);
+        }
+    }
+
+    private OMElement processStringInfo(String value,
+                                        String type,
+                                        SOAPHeader soapHeader) {
+        if (!"".equals(value) && value != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(type, addressingNamespace);
+            soapHeaderBlock.addChild(OMAbstractFactory.getSOAP11Factory().createText(value));
+            return soapHeaderBlock;
+        }
+        return null;
+    }
+
+    protected void addToSOAPHeader(EndpointReference epr,
+                                   String type,
+                                   SOAPHeader soapHeader) {
+        if (epr == null) {
+            return;
+        }
+        String address = epr.getAddress();
+        if (!"".equals(address) && address != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(type, addressingNamespace);
+            OMElement addressElement =
+                    OMAbstractFactory.getSOAP11Factory().createOMElement(EPR_ADDRESS,
+                            addressingNamespace);
+            soapHeaderBlock.addChild(addressElement);
+            addressElement.setText(address);
+
+        }
+
+        QName portType = epr.getPortType();
+        if (portType != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(EPR_PORT_TYPE, addressingNamespace);
+            soapHeaderBlock.addChild(OMAbstractFactory.getSOAP11Factory().createText(portType.getPrefix() + ":" + portType.getLocalPart()));
+        }
+
+        ServiceName serviceName = epr.getServiceName();
+        if (serviceName != null) {
+            SOAPHeaderBlock soapHeaderBlock =
+                    soapHeader.addHeaderBlock(EPR_SERVICE_NAME,
+                            addressingNamespace);
+            soapHeaderBlock.addAttribute(EPR_SERVICE_NAME_PORT_NAME,
+                    serviceName.getPortName(),
+                    addressingNamespace);
+            soapHeaderBlock.addChild(OMAbstractFactory.getSOAP11Factory().createText(serviceName.getName().getPrefix()
+                    + ":"
+                    + serviceName.getName().getLocalPart()));
+        }
+
+        AnyContentType referenceParameters = epr.getReferenceParameters();
+        processAnyContentType(referenceParameters, soapHeader);
+
+        AnyContentType referenceProperties = epr.getReferenceProperties();
+        processAnyContentType(referenceProperties, soapHeader);
+
+    }
+
+    private void processAnyContentType(AnyContentType referenceParameters,
+                                       SOAPHeader soapHeader) {
+        if (referenceParameters != null) {
+            Iterator iterator = referenceParameters.getKeys();
+            while (iterator.hasNext()) {
+                QName key = (QName) iterator.next();
+                String value = referenceParameters.getReferenceValue(key);
+                OMElement omElement =
+                        OMAbstractFactory.getSOAP11Factory().createOMElement(key, soapHeader);
+                soapHeader.addChild(omElement);
+                omElement.addChild(OMAbstractFactory.getSOAP11Factory().createText(value));
+            }
+        }
+    }
+}
+

Modified: webservices/axis/trunk/java/modules/core/samples/deployment/service2/META-INF/service.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/samples/deployment/service2/META-INF/service.xml?rev=169442&r1=169441&r2=169442&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/samples/deployment/service2/META-INF/service.xml (original)
+++ webservices/axis/trunk/java/modules/core/samples/deployment/service2/META-INF/service.xml Tue May 10 01:38:13 2005
@@ -4,10 +4,7 @@
     <parameter name="para2" locked="xsd:false">Colombo</parameter>
 
     <module ref="module1"></module>
-    <module ref="module2"></module>
-
-
-    <!--  Service TypeMapping -->
+       <!--  Service TypeMapping -->
 
     <!--
     Phases

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml?rev=169442&r1=169441&r2=169442&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml Tue May 10 01:38:13 2005
@@ -9,6 +9,7 @@
     <transportSender name="http" class="org.apache.axis.transport.http.HTTPTransportSender">
     </transportSender>
 
+    <module ref="addressing" />
 
     <phaseOrder type="inflow">
         <phase name="global"/>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java?rev=169442&r1=169441&r2=169442&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisEngine.java Tue May 10 01:38:13 2005
@@ -19,8 +19,6 @@
 import org.apache.axis.context.MessageContext;
 import org.apache.axis.context.ServiceContext;
 import org.apache.axis.description.AxisTransportIn;
-import org.apache.axis.handlers.addressing.AddressingInHandler;
-import org.apache.axis.handlers.addressing.AddressingOutHandler;
 import org.apache.axis.om.OMAbstractFactory;
 import org.apache.axis.om.SOAPBody;
 import org.apache.axis.om.SOAPEnvelope;
@@ -93,9 +91,9 @@
 
             // Add the phases that are are at Global scope
             chain.addPhases(engineContext.getPhases(AxisSystem.OUTFLOW));
-            Phase addressingPhase = new SimplePhase("addressing");
-            addressingPhase.addHandler(new AddressingOutHandler());
-            chain.addPhase(addressingPhase);
+            //Phase addressingPhase = new SimplePhase("addressing");
+            //addressingPhase.addHandler(new AddressingOutHandler());
+           // chain.addPhase(addressingPhase);
 
             // Receiving is always a matter of running the transport handlers first
 
@@ -142,9 +140,9 @@
                 chain.addPhases(transport.getPhases(AxisSystem.INFLOW));
             }
 
-            Phase addressingPhase = new SimplePhase("addressing");
-            addressingPhase.addHandler(new AddressingInHandler());
-            chain.addPhase(addressingPhase);
+          //  Phase addressingPhase = new SimplePhase("addressing");
+            //addressingPhase.addHandler(new AddressingInHandler());
+            //chain.addPhase(addressingPhase);
             //add the Global flow
             chain.addPhases(engineContext.getPhases(AxisSystem.INFLOW));
 

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java?rev=169442&r1=169441&r2=169442&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/engine/EnginePausingTest.java Tue May 10 01:38:13 2005
@@ -57,7 +57,6 @@
         engineContext = new SystemContext(engineRegistry);
 
         AxisOperation axisOp = new AxisOperation(operationName);
-
         mc = new MessageContext(engineContext, null, transportIn,transportOut,OperationContextFactory.createMEPContext(WSDLConstants.MEP_CONSTANT_IN_OUT,false,axisOp,null));
 
         mc.setTransportOut(transportOut);