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 2005/05/10 13:35:03 UTC

svn commit: r169451 - in /webservices/axis/trunk/java/modules/core: samples/deployment/service2/META-INF/ src/org/apache/axis/context/ src/org/apache/axis/deployment/ src/org/apache/axis/phaseresolver/ src/org/apache/axis/transport/http/ test-resources/deployment/ test/org/apache/axis/phaserule/

Author: deepal
Date: Tue May 10 04:35:01 2005
New Revision: 169451

URL: http://svn.apache.org/viewcvs?rev=169451&view=rev
Log:
Phase rule test cases

Added:
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/InvalidPhaseRuleTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/PreDispatchPhaseRuleTest.java
Modified:
    webservices/axis/trunk/java/modules/core/samples/deployment/service2/META-INF/service.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/server.xml
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java
    webservices/axis/trunk/java/modules/core/test-resources/deployment/server.xml

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=169451&r1=169450&r2=169451&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 04:35:01 2005
@@ -15,7 +15,6 @@
         <handler name="h1" class="Handler2">
             <order phase="service" phaseFirst="true"/>
         </handler>
-        <handler name="h2" class="Handler2"/>
     </inflow>
 
     <outflow>
@@ -25,9 +24,6 @@
     </outflow>
 
     <INfaultflow>
-        <handler name="h4" class="Handler2">
-        </handler>
-
         <handler name="h5" class="Handler2">
             <order phase="service"/>
         </handler>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java?rev=169451&r1=169450&r2=169451&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/OperationContext.java Tue May 10 04:35:01 2005
@@ -1,20 +1,20 @@
 package org.apache.axis.context;
 
 /*
- * 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.
- */
+* 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.
+*/
 
 import org.apache.axis.description.AxisOperation;
 import org.apache.axis.engine.AxisError;
@@ -198,7 +198,7 @@
         }
     }
 
-    
+
 //    public MessageContext createMessageContext(AxisM){
 //    
 //    }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=169451&r1=169450&r2=169451&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Tue May 10 04:35:01 2005
@@ -412,14 +412,17 @@
                             log.info("Invalid service" + currentFileItem.getName());
                             log.info("DeploymentException  " + de);
                             serviceStatus = "Error:\n" + de.getMessage();
+                            de.printStackTrace();
                         } catch (AxisFault axisFault) {
                             log.info("Invalid service" + currentFileItem.getName());
                             log.info("AxisFault  " + axisFault);
                             serviceStatus = "Error:\n" + axisFault.getMessage();
+                            axisFault.printStackTrace();
                         } catch (Exception e) {
                             log.info("Invalid service" + currentFileItem.getName());
                             log.info("Exception  " + e);
                             serviceStatus = "Error:\n" + e.getMessage();
+                            e.printStackTrace();
                         } finally {
                             if (serviceStatus.startsWith("Error:")) {
                                 engineconfig.getFaulytServices().put(getAxisServiceName(currentFileItem.getName()), serviceStatus);

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=169451&r1=169450&r2=169451&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 04:35:01 2005
@@ -12,6 +12,7 @@
     <module ref="addressing" />
 
     <phaseOrder type="inflow">
+
         <phase name="global"/>
         <phase name="transport"/>
         <phase name="Logging"/>

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java?rev=169451&r1=169450&r2=169451&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseHolder.java Tue May 10 04:35:01 2005
@@ -24,17 +24,11 @@
 import org.apache.axis.engine.AxisSystem;
 import org.apache.axis.engine.Handler;
 import org.apache.axis.engine.SimplePhase;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
 /**
  * This class hold all the phases found in the service.xml and server.xml
  */
 public class PhaseHolder {
-    /**
-     * Field log
-     */
-    private Log log = LogFactory.getLog(getClass());
 
     /**
      * Field phaseholder
@@ -53,7 +47,6 @@
     private ArrayList faultInPhases;
     private ArrayList faultOutPhases;
 
-    private int flowType = -1;
 
     /**
      * Constructor PhaseHolder
@@ -96,7 +89,6 @@
                     break;
                 }
         }
-        this.flowType = flowType;
     }
 
     private void fillFlowPhases() {
@@ -181,15 +173,6 @@
         + " dose not exit in server.xml");
         }
         }*/
-    }
-
-    /**
-     * Method addPhase
-     *
-     * @param phase
-     */
-    private void addPhase(PhaseMetadata phase) {
-        phaseholder.add(phase);
     }
 
     /**

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java?rev=169451&r1=169450&r2=169451&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java Tue May 10 04:35:01 2005
@@ -186,7 +186,7 @@
 
                 // todo change this in properway
                 if (metadata.getRules().getPhaseName().equals("")) {
-                    metadata.getRules().setPhaseName("service");
+                    throw new PhaseException("Phase dose not specified");
                 }
                 allHandlers.add(metadata);
             }
@@ -274,7 +274,7 @@
 
                     // todo change this in properway
                     if (metadata.getRules().getPhaseName().equals("")) {
-                        metadata.getRules().setPhaseName("transport");
+                         throw new PhaseException("Phase dose not specified");
                     }
                     phaseHolder.addHandler(metadata);
                 }
@@ -314,7 +314,7 @@
 
                     // todo change this in properway
                     if (metadata.getRules().getPhaseName().equals("")) {
-                        metadata.getRules().setPhaseName("transport");
+                         throw new PhaseException("Phase dose not specified");
                     }
                     phaseHolder.addHandler(metadata);
                 }

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java?rev=169451&r1=169450&r2=169451&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/transport/http/SimpleHTTPServer.java Tue May 10 04:35:01 2005
@@ -90,7 +90,7 @@
     public SimpleHTTPServer(String dir, ServerSocket serverSoc) throws AxisFault {
         try {
             this.serverSocket = serverSoc;
-            Class erClass = Class.forName("org.apache.axis.deployment.EngineContextFactoryImpl");
+           // Class erClass = Class.forName("org.apache.axis.deployment.EngineContextFactoryImpl");
             EngineContextFactory erfac = new EngineContextFactory();
             this.engineReg = erfac.buildEngineContext(dir);
             Thread.sleep(2000);

Modified: webservices/axis/trunk/java/modules/core/test-resources/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test-resources/deployment/server.xml?rev=169451&r1=169450&r2=169451&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test-resources/deployment/server.xml (original)
+++ webservices/axis/trunk/java/modules/core/test-resources/deployment/server.xml Tue May 10 04:35:01 2005
@@ -9,14 +9,22 @@
     <module ref="module1"/>
      <transportReceiver name="http">
         <inflow>
-            <handler name="h1" class="org.apache.axis.deployment.SpeakingHandler"/>
-            <handler name="h2" class="org.apache.axis.deployment.SpeakingHandler"/>
+            <handler name="h1" class="org.apache.axis.deployment.SpeakingHandler">
+                <order phase="transport"/>
+            </handler>
+            <handler name="h2" class="org.apache.axis.deployment.SpeakingHandler">
+                <order phase="transport"/>
+            </handler>
         </inflow>
     </transportReceiver>
     <transportSender name="http" class="org.apache.axis.transport.http.HTTPTransportSender">
         <outflow>
-            <handler name="h1" class="org.apache.axis.deployment.SpeakingHandler"/>
-            <handler name="h2" class="org.apache.axis.deployment.SpeakingHandler"/>
+            <handler name="h1" class="org.apache.axis.deployment.SpeakingHandler">
+                <order phase="transport"/>
+            </handler>
+            <handler name="h2" class="org.apache.axis.deployment.SpeakingHandler">
+                <order phase="transport"/>
+            </handler>
         </outflow>
     </transportSender>
   <!--

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/InvalidPhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/InvalidPhaseRuleTest.java?rev=169451&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/InvalidPhaseRuleTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/InvalidPhaseRuleTest.java Tue May 10 04:35:01 2005
@@ -0,0 +1,172 @@
+package org.apache.axis.phaserule;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.PhaseRule;
+import org.apache.axis.engine.AxisSystem;
+import org.apache.axis.engine.AxisSystemImpl;
+import org.apache.axis.engine.Handler;
+import org.apache.axis.phaseresolver.PhaseHolder;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+
+/*
+ * 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: 4:35:33 PM
+ */
+public class InvalidPhaseRuleTest extends AbstractTestCase {
+
+    InvalidPhaseRuleTest phaserul;
+    AxisSystem registry;
+
+    public InvalidPhaseRuleTest(String testName) {
+        super(testName);
+    }
+
+    public void testInvalidPhaseRule1() {
+        try {
+            super.setUp();
+            phaserul = new InvalidPhaseRuleTest("");
+            AxisGlobal global = new AxisGlobal();
+            registry = new AxisSystemImpl(global);
+            ArrayList inPhase = new ArrayList();
+
+            inPhase.add("global");
+            inPhase.add("service");
+            ((AxisSystemImpl) registry).setInPhases(inPhase);
+            ((AxisSystemImpl) registry).setInFaultPhases(inPhase);
+            ((AxisSystemImpl) registry).setOutFaultPhases(inPhase);
+            ((AxisSystemImpl) registry).setOutPhases(inPhase);
+
+            Handler han = null;
+            PhaseHolder ph = new PhaseHolder(registry);
+            ph.setFlowType(1);
+
+
+            HandlerMetadata hm = new HandlerMetadata();
+            hm.setClassName("org.apache.axis.handlers.AbstractHandler");
+            hm.setHandler(han);
+            hm.setName(new QName("H1"));
+            PhaseRule rule = new PhaseRule();
+            rule.setPhaseName("global");
+            rule.setPhaseFirst(true);
+            hm.setRules(rule);
+            ph.addHandler(hm);
+
+            HandlerMetadata hm1 = new HandlerMetadata();
+            hm1.setClassName("org.apache.axis.handlers.AbstractHandler");
+            hm1.setHandler(han);
+            hm1.setName(new QName("H2"));
+            PhaseRule rule1 = new PhaseRule();
+            rule1.setPhaseName("global");
+            rule1.setAfter("H1");
+            hm1.setRules(rule1);
+            ph.addHandler(hm1);
+
+            HandlerMetadata hm3 = new HandlerMetadata();
+            hm3.setClassName("org.apache.axis.handlers.AbstractHandler");
+            hm3.setHandler(han);
+            hm3.setName(new QName("H4"));
+            PhaseRule rule3 = new PhaseRule();
+            rule3.setPhaseName("Logging");
+            hm3.setRules(rule3);
+            ph.addHandler(hm3);
+
+
+            ArrayList oh = ph.getOrderHandler();
+            for (int i = 0; i < oh.size(); i++) {
+                HandlerMetadata metadata = (HandlerMetadata) oh.get(i);
+                System.out.println("Name:" + metadata.getName().getLocalPart());
+            }
+            fail("this must failed gracefully with PhaseException ");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+    public void testInvalidPhaseRule2() {
+        try {
+            super.setUp();
+            phaserul = new InvalidPhaseRuleTest("");
+            AxisGlobal global = new AxisGlobal();
+            registry = new AxisSystemImpl(global);
+            ArrayList inPhase = new ArrayList();
+
+            inPhase.add("global");
+            inPhase.add("service");
+            ((AxisSystemImpl) registry).setInPhases(inPhase);
+            ((AxisSystemImpl) registry).setInFaultPhases(inPhase);
+            ((AxisSystemImpl) registry).setOutFaultPhases(inPhase);
+            ((AxisSystemImpl) registry).setOutPhases(inPhase);
+
+            Handler han = null;
+            PhaseHolder ph = new PhaseHolder(registry);
+            ph.setFlowType(1);
+
+
+            HandlerMetadata hm = new HandlerMetadata();
+            hm.setClassName("org.apache.axis.handlers.AbstractHandler");
+            hm.setHandler(han);
+            hm.setName(new QName("H1"));
+            PhaseRule rule = new PhaseRule();
+            rule.setPhaseName("global");
+            rule.setPhaseFirst(true);
+            rule.setPhaseLast(true);
+            hm.setRules(rule);
+            ph.addHandler(hm);
+
+            HandlerMetadata hm1 = new HandlerMetadata();
+            hm1.setClassName("org.apache.axis.handlers.AbstractHandler");
+            hm1.setHandler(han);
+            hm1.setName(new QName("H2"));
+            PhaseRule rule1 = new PhaseRule();
+            rule1.setPhaseName("global");
+            rule1.setAfter("H1");
+            hm1.setRules(rule1);
+            ph.addHandler(hm1);
+
+            HandlerMetadata hm3 = new HandlerMetadata();
+            hm3.setClassName("org.apache.axis.handlers.AbstractHandler");
+            hm3.setHandler(han);
+            hm3.setName(new QName("H4"));
+            PhaseRule rule3 = new PhaseRule();
+            rule3.setPhaseName("Logging");
+            hm3.setRules(rule3);
+            ph.addHandler(hm3);
+
+
+            ArrayList oh = ph.getOrderHandler();
+            for (int i = 0; i < oh.size(); i++) {
+                HandlerMetadata metadata = (HandlerMetadata) oh.get(i);
+                System.out.println("Name:" + metadata.getName().getLocalPart());
+            }
+            fail("this must failed gracefully with PhaseException ");
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+
+}

Added: webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/PreDispatchPhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/PreDispatchPhaseRuleTest.java?rev=169451&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/PreDispatchPhaseRuleTest.java (added)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis/phaserule/PreDispatchPhaseRuleTest.java Tue May 10 04:35:01 2005
@@ -0,0 +1,133 @@
+package org.apache.axis.phaserule;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.phaseresolver.PhaseHolder;
+import org.apache.axis.description.AxisGlobal;
+import org.apache.axis.description.HandlerMetadata;
+import org.apache.axis.description.PhaseRule;
+import org.apache.axis.engine.AxisSystem;
+import org.apache.axis.engine.AxisSystemImpl;
+import org.apache.axis.engine.Handler;
+
+import javax.xml.namespace.QName;
+import java.util.ArrayList;
+
+/*
+* 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: 4:28:27 PM
+ */
+public class PreDispatchPhaseRuleTest  extends AbstractTestCase{
+
+    PreDispatchPhaseRuleTest phaserul;
+    AxisSystem registry;
+
+    public PreDispatchPhaseRuleTest(String testName) {
+        super(testName);
+    }
+
+    public void testPhaseRule() throws Exception {
+        phaserul = new PreDispatchPhaseRuleTest("");
+        AxisGlobal global = new AxisGlobal();
+        registry = new AxisSystemImpl(global);
+        ArrayList inPhase = new ArrayList();
+
+        inPhase.add("global");
+        inPhase.add("transport");
+        inPhase.add("Logging");
+        inPhase.add("service");
+        ((AxisSystemImpl) registry).setInPhases(inPhase);
+        ((AxisSystemImpl) registry).setInFaultPhases(inPhase);
+        ((AxisSystemImpl) registry).setOutFaultPhases(inPhase);
+        ((AxisSystemImpl) registry).setOutPhases(inPhase);
+
+        Handler han = null;
+        PhaseHolder ph = new PhaseHolder(registry);
+        ph.setFlowType(1);
+
+
+        HandlerMetadata pre = new HandlerMetadata();
+        pre.setClassName("org.apache.axis.handlers.AbstractHandler");
+        pre.setHandler(han);
+        pre.setName(new QName("pre-H1"));
+        PhaseRule pre_rule1 = new PhaseRule();
+        pre_rule1.setPhaseName("pre-dispatch");
+        pre.setRules(pre_rule1);
+        ph.addHandler(pre);
+
+        HandlerMetadata pre2 = new HandlerMetadata();
+        pre2.setClassName("org.apache.axis.handlers.AbstractHandler");
+        pre2.setHandler(han);
+        pre2.setName(new QName("pre-H2"));
+        PhaseRule prerule2 = new PhaseRule();
+        prerule2.setPhaseName("pre-dispatch");
+        pre2.setRules(prerule2);
+        ph.addHandler(pre2);
+
+
+        HandlerMetadata hm = new HandlerMetadata();
+        hm.setClassName("org.apache.axis.handlers.AbstractHandler");
+        hm.setHandler(han);
+        hm.setName(new QName("H1"));
+        PhaseRule rule = new PhaseRule();
+        rule.setPhaseName("global");
+        rule.setPhaseFirst(true);
+        hm.setRules(rule);
+        ph.addHandler(hm);
+
+        HandlerMetadata hm1 = new HandlerMetadata();
+        hm1.setClassName("org.apache.axis.handlers.AbstractHandler");
+        hm1.setHandler(han);
+        hm1.setName(new QName("H2"));
+        PhaseRule rule1 = new PhaseRule();
+        rule1.setPhaseName("global");
+        rule1.setAfter("H1");
+        hm1.setRules(rule1);
+        ph.addHandler(hm1);
+
+        HandlerMetadata hm2 = new HandlerMetadata();
+        hm2.setClassName("org.apache.axis.handlers.AbstractHandler");
+        hm2.setHandler(han);
+        hm2.setName(new QName("H3"));
+        PhaseRule rule2 = new PhaseRule();
+        rule2.setPhaseName("global");
+        rule2.setAfter("H1");
+        rule2.setBefore("H2");
+        hm2.setRules(rule2);
+        ph.addHandler(hm2);
+
+        HandlerMetadata hm3 = new HandlerMetadata();
+        hm3.setClassName("org.apache.axis.handlers.AbstractHandler");
+        hm3.setHandler(han);
+        hm3.setName(new QName("H4"));
+        PhaseRule rule3 = new PhaseRule();
+        rule3.setPhaseName("Logging");
+        hm3.setRules(rule3);
+        ph.addHandler(hm3);
+
+
+        ArrayList oh = ph.getOrderHandler();
+        for (int i = 0; i < oh.size(); i++) {
+            HandlerMetadata metadata = (HandlerMetadata) oh.get(i);
+            System.out.println("Name:" + metadata.getName().getLocalPart());
+        }
+    }
+}