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 ch...@apache.org on 2005/07/29 17:34:17 UTC

svn commit: r226383 - in /webservices/axis/trunk/java/modules: common/src/org/apache/axis2/ core/src/org/apache/axis2/engine/ core/test/org/apache/axis2/context/ core/test/org/apache/axis2/deployment/ core/test/org/apache/axis2/description/ core/test/o...

Author: chinthaka
Date: Fri Jul 29 08:31:15 2005
New Revision: 226383

URL: http://svn.apache.org/viewcvs?rev=226383&view=rev
Log:
- improved fault handling in engine.
- added a new fault exception interface

Added:
    webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/FaultHandlingTest.java
Modified:
    webservices/axis/trunk/java/modules/common/src/org/apache/axis2/AxisFault.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadModuleTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServerXMLTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServiceXMLTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildERWithDeploymentTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildWithAddressingTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/TransportDeploymentTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/description/RegistryTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseRuleTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/HTTPTrasportHeaderParsingTest.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java
    webservices/axis/trunk/java/modules/samples/project.xml
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/HandlerFailureTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPProcessingException.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java

Modified: webservices/axis/trunk/java/modules/common/src/org/apache/axis2/AxisFault.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/common/src/org/apache/axis2/AxisFault.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/common/src/org/apache/axis2/AxisFault.java (original)
+++ webservices/axis/trunk/java/modules/common/src/org/apache/axis2/AxisFault.java Fri Jul 29 08:31:15 2005
@@ -29,7 +29,7 @@
  * <li>Fault details; an xml tree of fault specific stuff
  * </ol>
  */
-public class AxisFault extends RemoteException {
+public class AxisFault extends RemoteException implements SOAPFaultException{
 
     private String soapFaultCode;
 
@@ -94,5 +94,13 @@
     public AxisFault(String messageText, String faultCode) {
         super(messageText);
         this.soapFaultCode = faultCode;
+    }
+
+    public String getFaultCode() {
+        return soapFaultCode;
+    }
+
+    public void setFaultCode(String soapFaultCode) {
+        this.soapFaultCode = soapFaultCode;
     }
 }

Added: webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java?rev=226383&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java (added)
+++ webservices/axis/trunk/java/modules/common/src/org/apache/axis2/SOAPFaultException.java Fri Jul 29 08:31:15 2005
@@ -0,0 +1,27 @@
+package org.apache.axis2;
+
+/*
+ * 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 : Eran Chinthaka (chinthaka@apache.org)
+ */
+
+public interface SOAPFaultException {
+    public String getFaultCode();
+    public void setFaultCode(String faultCode);
+
+    public String getMessage();
+
+}

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/engine/AxisEngine.java Fri Jul 29 08:31:15 2005
@@ -15,8 +15,8 @@
  */
 package org.apache.axis2.engine;
 
-import java.util.ArrayList;
-
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.SOAPFaultException;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.context.OperationContext;
@@ -24,19 +24,16 @@
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.soap.SOAPBody;
-import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.soap.SOAPFault;
-import org.apache.axis2.soap.SOAPFaultCode;
-import org.apache.axis2.soap.SOAPFaultDetail;
-import org.apache.axis2.soap.SOAPFaultReason;
-import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.soap.*;
 import org.apache.axis2.soap.impl.llom.SOAPProcessingException;
+import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 import org.apache.axis2.transport.TransportSender;
-import org.apache.axis2.AxisFault;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
+import java.util.ArrayList;
+
 /**
  * There is one engine for the Server and the Client. the send() and receive()
  * Methods are the basic operations the Sync, Async messageing are build on top.
@@ -74,7 +71,7 @@
         //find and invoke the Phases        
         OperationContext operationContext = msgContext.getOperationContext();
         ArrayList phases =
-            operationContext.getAxisOperation().getPhasesOutFlow();
+                operationContext.getAxisOperation().getPhasesOutFlow();
         if (msgContext.isPaused()) {
             // the message has paused, so rerun them from the position they stoped. The Handler
             //who paused the Message will be the first one to run
@@ -108,7 +105,7 @@
         ConfigurationContext sysCtx = msgContext.getSystemContext();
         OperationDescription operationDescription = null;
         ArrayList preCalculatedPhases =
-            sysCtx
+                sysCtx
                 .getAxisConfiguration()
                 .getInPhasesUptoAndIncludingPostDispatch();
         ArrayList operationSpecificPhases = null;
@@ -121,32 +118,33 @@
             verifyContextBuilt(msgContext);
             //resume operation specific phases
             OperationContext operationContext =
-                msgContext.getOperationContext();
+                    msgContext.getOperationContext();
             operationDescription = operationContext.getAxisOperation();
             operationSpecificPhases =
-                operationDescription.getRemainingPhasesInFlow();
+                    operationDescription.getRemainingPhasesInFlow();
             resumeInvocationPhases(operationSpecificPhases, msgContext);
         } else {
             invokePhases(preCalculatedPhases, msgContext);
             verifyContextBuilt(msgContext);
             OperationContext operationContext =
-                msgContext.getOperationContext();
+                    msgContext.getOperationContext();
             operationDescription = operationContext.getAxisOperation();
             operationSpecificPhases =
-                operationDescription.getRemainingPhasesInFlow();
+                    operationDescription.getRemainingPhasesInFlow();
             invokePhases(operationSpecificPhases, msgContext);
         }
 
         if (msgContext.isServerSide() && !msgContext.isPaused()) {
             // invoke the Message Receivers
             MessageReceiver receiver =
-                operationDescription.getMessageReciever();
+                    operationDescription.getMessageReciever();
             receiver.recieve(msgContext);
         }
     }
 
     /**
      * This Method Send the SOAP Fault to a Other SOAP Node
+     *
      * @param msgContext
      * @throws AxisFault
      */
@@ -174,6 +172,7 @@
 
     /**
      * This is invoked when a SOAP Fault is received from a Other SOAP Node
+     *
      * @param msgContext
      * @throws AxisFault
      */
@@ -185,7 +184,7 @@
             //Dual Channel response. So try to dispatch the Service 
             ConfigurationContext sysCtx = msgContext.getSystemContext();
             ArrayList phases =
-                sysCtx
+                    sysCtx
                     .getAxisConfiguration()
                     .getInPhasesUptoAndIncludingPostDispatch();
 
@@ -218,28 +217,26 @@
      * @param e
      * @throws AxisFault
      */
-    public MessageContext createFaultMessageContext(
-        MessageContext processingContext,
-        Throwable e)
-        throws AxisFault {
+    public MessageContext createFaultMessageContext(MessageContext processingContext,
+                                                    Throwable e)
+            throws AxisFault {
         if (processingContext.isProcessingFault()) {
             //We get the error file processing the fault. nothing we can do
             throw new AxisFault(Messages.getMessage("errorwhileProcessingFault"));
         }
 
         MessageContext faultContext =
-            new MessageContext(
-                engineContext,
-                processingContext.getSessionContext(),
-                processingContext.getTransportIn(),
-                processingContext.getTransportOut());
+                new MessageContext(engineContext,
+                        processingContext.getSessionContext(),
+                        processingContext.getTransportIn(),
+                        processingContext.getTransportOut());
 
         faultContext.setProcessingFault(true);
         if (processingContext.getFaultTo() != null) {
             faultContext.setFaultTo(processingContext.getFaultTo());
         } else {
             Object writer =
-                processingContext.getProperty(MessageContext.TRANSPORT_OUT);
+                    processingContext.getProperty(MessageContext.TRANSPORT_OUT);
             if (writer != null) {
                 faultContext.setProperty(MessageContext.TRANSPORT_OUT, writer);
             } else {
@@ -247,29 +244,29 @@
             }
         }
 
-        faultContext.setOperationContext(
-            processingContext.getOperationContext());
+        faultContext.setOperationContext(processingContext.getOperationContext());
         faultContext.setProcessingFault(true);
         faultContext.setServerSide(true);
         SOAPEnvelope envelope = null;
 
-        if (SOAP12Constants
-            .SOAP_ENVELOPE_NAMESPACE_URI
-            .equals(processingContext.getEnvelope().getNamespace().getName())) {
+        if (processingContext.getEnvelope() != null && SOAP12Constants
+                .SOAP_ENVELOPE_NAMESPACE_URI
+                .equals(processingContext.getEnvelope().getNamespace().getName())) {
             envelope =
-                OMAbstractFactory.getSOAP12Factory().getDefaultFaultEnvelope();
+                    OMAbstractFactory.getSOAP12Factory().getDefaultFaultEnvelope();
         } else {
             envelope =
-                OMAbstractFactory.getSOAP11Factory().getDefaultFaultEnvelope();
+                    OMAbstractFactory.getSOAP11Factory().getDefaultFaultEnvelope();
         }
 
+
+
         // TODO do we need to set old Headers back?
-        SOAPBody body = envelope.getBody();
 
         //            body.addFault(new AxisFault(e.getMessage(), e));
-        body.getFault().setException(new AxisFault(e));
+//        body.getFault().setException(new AxisFault(e));
         extractFaultInformationFromMessageContext(processingContext,
-            envelope.getBody().getFault(), e);
+                envelope.getBody().getFault(), e);
 
         faultContext.setEnvelope(envelope);
         sendFault(faultContext);
@@ -285,72 +282,108 @@
      * it has an attribute to store the fault code. The fault reason can be extracted from the
      * message of the exception. I opted to put the stacktrace under the detail element.
      * eg : <Detail>
-     *          <Exception> stack trace goes here </Exception>
-     *      <Detail>
-     *
+     * <Exception> stack trace goes here </Exception>
+     * <Detail>
+     * <p/>
      * If those information can not be extracted from any of the above places, I default the soap
      * fault values to following.
      * <Fault>
-     *      <Code>
-     *          <Value>env:Receiver</Value>
-     *      </Code>
-     *      <Reason>
-     *          <Text>unknown</Text>
-     *      </Reason>
-     *      <Role/>
-     *      <Node/>
-     *      <Detail/>
+     * <Code>
+     * <Value>env:Receiver</Value>
+     * </Code>
+     * <Reason>
+     * <Text>unknown</Text>
+     * </Reason>
+     * <Role/>
+     * <Node/>
+     * <Detail/>
      * </Fault>
-     *
+     * <p/>
      * -- EC
      *
      * @param context
      * @param fault
      * @param e
      */
-    private void extractFaultInformationFromMessageContext(
-        MessageContext context,
-        SOAPFault fault, Throwable e) {
+    private void extractFaultInformationFromMessageContext(MessageContext context,
+                                                           SOAPFault fault, Throwable e) {
+        SOAPFaultException soapException = null;
+        String soapNamespaceURI = "";
+
+        // get the current SOAP version
+        if (context == null || "".equals(context.getSOAPVersion()) || context.getSOAPVersion() == null) {
+            // defaulting to SOAP 1.2
+            soapNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+        } else {
+            soapNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+        }
+
+
+        if (e instanceof SOAPProcessingException) {
+            soapException = (SOAPProcessingException) e;
+        } else if (e instanceof AxisFault) {
+            if (e.getCause() instanceof SOAPProcessingException) {
+                soapException = (SOAPProcessingException) e.getCause();
+            } else {
+                soapException = (SOAPFaultException) e;
+            }
+        } else {
+            // we have recd an instance of just the Exception class
+        }
+
         Object faultCode =
-            context.getProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME);
+                context.getProperty(SOAP12Constants.SOAP_FAULT_CODE_LOCAL_NAME);
+        String soapFaultCode = "";
         if (faultCode != null) {
             fault.setCode((SOAPFaultCode) faultCode);
-        }else if((e != null) && (e instanceof SOAPProcessingException)){
-            String soapFaultCode = ((SOAPProcessingException) e).getSoapFaultCode();
+        } else if (soapException != null) {
+            soapFaultCode = soapException.getFaultCode();
+
+            // defaulting to fault code Sender, if no message is available
+            soapFaultCode = ("".equals(soapFaultCode) || soapFaultCode == null) ? getSenderFaultCode(soapNamespaceURI) : soapFaultCode;
             fault.getCode().getValue().setText(soapFaultCode);
         }
 
+
         Object faultReason =
-            context.getProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME);
+                context.getProperty(SOAP12Constants.SOAP_FAULT_REASON_LOCAL_NAME);
+        String message = "";
         if (faultReason != null) {
             fault.setReason((SOAPFaultReason) faultReason);
-        }else if (e != null){
-            String message = e.getMessage();
-            fault.getReason().getSOAPText().setText( ("".equals(message) || message == null) ? message : "unknown");
+        } else if (soapException != null) {
+            message = soapException.getMessage();
+
+            // defaulting to reason, unknown, if no reason is available
+            message = ("".equals(message) || message == null) ? "unknown" : message;
+            fault.getReason().getSOAPText().setText(message);
         }
 
+
         Object faultRole =
-            context.getProperty(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME);
+                context.getProperty(SOAP12Constants.SOAP_FAULT_ROLE_LOCAL_NAME);
         if (faultRole != null) {
             fault.getRole().setText((String) faultRole);
-        }else{
+        } else {
             // TODO : get the role of this server and assign it here
+            fault.getRole().setText("http://myAxisServer/role/default");
         }
 
         Object faultNode =
-            context.getProperty(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME);
+                context.getProperty(SOAP12Constants.SOAP_FAULT_NODE_LOCAL_NAME);
         if (faultNode != null) {
             fault.getNode().setText((String) faultNode);
-        }else{
+        } else {
             // TODO : get the node of this server and assign it here
+            fault.getNode().setText("http://myAxisServer/role/default");
+
         }
 
         Object faultDetail =
-            context.getProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
+                context.getProperty(SOAP12Constants.SOAP_FAULT_DETAIL_LOCAL_NAME);
         if (faultDetail != null) {
             fault.setDetail((SOAPFaultDetail) faultDetail);
-        }else{
-//            fault.getDetail().se
+        } else if (fault.getException() == null){
+            fault.setException(new Exception(e));
         }
     }
 
@@ -367,16 +400,16 @@
     }
 
     private void invokePhases(ArrayList phases, MessageContext msgctx)
-        throws AxisFault {
+            throws AxisFault {
         int count = phases.size();
-        for (int i = 0;(i < count && !msgctx.isPaused()); i++) {
+        for (int i = 0; (i < count && !msgctx.isPaused()); i++) {
             Phase phase = (Phase) phases.get(i);
             phase.invoke(msgctx);
         }
     }
 
     public void resumeInvocationPhases(ArrayList phases, MessageContext msgctx)
-        throws AxisFault {
+            throws AxisFault {
         msgctx.setPausedFalse();
         int count = phases.size();
         boolean foundMatch = false;
@@ -385,9 +418,8 @@
             Phase phase = (Phase) phases.get(i);
             if (phase.getPhaseName().equals(msgctx.getPausedPhaseName())) {
                 foundMatch = true;
-                phase.invokeStartFromHandler(
-                    msgctx.getPausedHandlerName(),
-                    msgctx);
+                phase.invokeStartFromHandler(msgctx.getPausedHandlerName(),
+                        msgctx);
             } else {
                 if (foundMatch) {
                     phase.invoke(msgctx);
@@ -440,5 +472,13 @@
      */
     public boolean clearStorage(ConfigurationContext context) {
         return context.getStorage().clean();
+    }
+
+    private String getSenderFaultCode(String soapNamespace) {
+        return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespace) ? SOAP12Constants.FAULT_CODE_SENDER : SOAP11Constants.FAULT_CODE_SENDER;
+    }
+
+    private String getReceiverFaultCode(String soapNamespace) {
+        return SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(soapNamespace) ? SOAP12Constants.FAULT_CODE_RECEIVER : SOAP11Constants.FAULT_CODE_RECEIVER;
     }
 }

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/context/OperationContextTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.context;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.addressing.miheaders.RelatesTo;
 import org.apache.axis2.description.OperationDescription;
 import org.apache.axis2.description.ServiceDescription;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadModuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadModuleTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadModuleTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadModuleTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.deployment;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.engine.AxisConfigurationImpl;
+import org.apache.axis2.AbstractTestCase;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServerXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServerXMLTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServerXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServerXMLTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.deployment;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.engine.AxisConfigurationImpl;
+import org.apache.axis2.AbstractTestCase;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServiceXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServiceXMLTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServiceXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BadServiceXMLTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.deployment;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.AbstractTestCase;
 
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildERWithDeploymentTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildERWithDeploymentTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildERWithDeploymentTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildERWithDeploymentTest.java Fri Jul 29 08:31:15 2005
@@ -16,12 +16,12 @@
 
 package org.apache.axis2.deployment;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.context.ConfigurationContextFactory;
 import org.apache.axis2.description.Flow;
 import org.apache.axis2.description.OperationDescription;
 import org.apache.axis2.description.ServiceDescription;
 import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.AbstractTestCase;
 
 import javax.xml.namespace.QName;
 

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildWithAddressingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildWithAddressingTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildWithAddressingTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/BuildWithAddressingTest.java Fri Jul 29 08:31:15 2005
@@ -2,6 +2,7 @@
 
 import org.apache.axis2.AbstractTestCase;
 
+
 /*
 * Copyright 2004,2005 The Apache Software Foundation.
 *

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/TransportDeploymentTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/TransportDeploymentTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/TransportDeploymentTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/deployment/TransportDeploymentTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.deployment;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.description.TransportInDescription;
 import org.apache.axis2.description.TransportOutDescription;
 import org.apache.axis2.engine.AxisConfiguration;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/description/RegistryTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/description/RegistryTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/description/RegistryTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/description/RegistryTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.description;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Handler;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/engine/MessageContextTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.engine;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.ServiceDescription;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/misc/MiscTest.java Fri Jul 29 08:31:15 2005
@@ -16,8 +16,8 @@
 
 package org.apache.axis2.misc;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.context.SessionContext;
 
 import java.lang.reflect.InvocationTargetException;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseRuleTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseRuleTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/InvalidPhaseRuleTest.java Fri Jul 29 08:31:15 2005
@@ -1,12 +1,12 @@
 package org.apache.axis2.phaserule;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.PhaseRule;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.phaseresolver.PhaseHolder;
+import org.apache.axis2.AbstractTestCase;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PhaseRuleTest.java Fri Jul 29 08:31:15 2005
@@ -1,12 +1,12 @@
 package org.apache.axis2.phaserule;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.PhaseRule;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.phaseresolver.PhaseHolder;
+import org.apache.axis2.AbstractTestCase;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/phaserule/PreDispatchPhaseRuleTest.java Fri Jul 29 08:31:15 2005
@@ -1,12 +1,12 @@
 package org.apache.axis2.phaserule;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.description.HandlerDescription;
 import org.apache.axis2.description.PhaseRule;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisConfigurationImpl;
 import org.apache.axis2.engine.Handler;
 import org.apache.axis2.phaseresolver.PhaseHolder;
+import org.apache.axis2.AbstractTestCase;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/HTTPTrasportHeaderParsingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/HTTPTrasportHeaderParsingTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/HTTPTrasportHeaderParsingTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/HTTPTrasportHeaderParsingTest.java Fri Jul 29 08:31:15 2005
@@ -17,8 +17,8 @@
 package org.apache.axis2.transport;
 
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.transport.http.HTTPTransportReceiver;
 

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/util/threadpool/TestThreadPool.java Fri Jul 29 08:31:15 2005
@@ -1,7 +1,7 @@
 package org.apache.axis2.util.threadpool;
 
-import org.apache.axis2.AbstractTestCase;
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.AbstractTestCase;
 
 import java.util.ArrayList;
 import java.util.List;

Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Fri Jul 29 08:31:15 2005
@@ -166,11 +166,13 @@
                 <exclude>**/*InteropStubTest.java</exclude>
                 <exclude>**/*EchoRawXMLChunckedTest.java</exclude>
                 <exclude>**org/apache/axis2/mail/*.java</exclude>
+                <exclude>**/*FaultHandlingTest.java</exclude>
                 <!--
 		<exclude>**/*SOAP12Test.java</exclude>
                 <exclude>**/*SOAP12TestWithFaults.java</exclude>
-		-->
-                <!--		<exclude>**/*MailEchoRawXMLTest.java</exclude>
+                
+
+               <exclude>**/*MailEchoRawXMLTest.java</exclude>
                 <exclude>**/*MailOneWayRawXMLTest.java</exclude>
                 <exclude>**/*MailRequestResponseRawXMLTest.java</exclude>
                 <exclude>**/*CommonsHTTPEchoRawXMLTest.java</exclude>

Added: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/FaultHandlingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/FaultHandlingTest.java?rev=226383&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/FaultHandlingTest.java (added)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/FaultHandlingTest.java Fri Jul 29 08:31:15 2005
@@ -0,0 +1,136 @@
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.engine.util.MyInOutMEPClient;
+import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.impl.OMOutputImpl;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.FileReader;
+import java.io.File;
+
+import junit.framework.TestCase;
+
+/*
+ * 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 : Eran Chinthaka (chinthaka@apache.org)
+ */
+
+public class FaultHandlingTest extends TestCase{
+    private EndpointReference targetEPR =
+            new EndpointReference("http://127.0.0.1:"
+            + (UtilServer.TESTING_PORT)
+            + "/axis/services/EchoXMLService/echoOMElement");
+    private Log log = LogFactory.getLog(getClass());
+    private QName serviceName = new QName("EchoXMLService");
+    private QName operationName = new QName("echoOMElement");
+    private QName transportName = new QName("http://localhost/my",
+            "NullTransport");
+
+    private AxisConfiguration engineRegistry;
+    private MessageContext mc;
+    //private Thread thisThread;
+    // private SimpleHTTPServer sas;
+    private ServiceContext serviceContext;
+    private ServiceDescription service;
+    protected String testResourceDir = "test-resources";
+
+
+    private boolean finish = false;
+
+    /**
+     * @param testName
+     */
+    public FaultHandlingTest(String testName) {
+    }
+
+    protected void setUp() throws Exception {
+        UtilServer.start();
+        service =
+                Utils.createSimpleService(serviceName,
+                        Echo.class.getName(),
+                        operationName);
+        UtilServer.deployService(service);
+        serviceContext =
+                UtilServer.getConfigurationContext().createServiceContext(service.getName());
+
+    }
+
+//    public void testInvalidSOAPMessage() throws AxisFault, XMLStreamException {
+//        SOAPFactory fac = OMAbstractFactory.getSOAP12Factory();
+//
+//        SOAPEnvelope soapEnvelope = fac.createSOAPEnvelope();
+//        fac.createSOAPHeader(soapEnvelope);
+//        fac.createSOAPHeader(soapEnvelope);
+//        fac.createSOAPBody(soapEnvelope);
+//
+//        MyInOutMEPClient inOutMEPClient = getMyInOutMEPClient();
+//
+//        SOAPEnvelope result =
+//                inOutMEPClient.invokeBlockingWithEnvelopeOut(operationName.getLocalPart(), soapEnvelope);
+//
+//        OMOutputImpl output = new OMOutputImpl(System.out, false);
+//        result.serialize(output);
+//        output.flush();
+//
+//        inOutMEPClient.close();
+//    }
+
+    private MyInOutMEPClient getMyInOutMEPClient() throws AxisFault {
+        MyInOutMEPClient inOutMEPClient = new MyInOutMEPClient();
+        inOutMEPClient.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+        inOutMEPClient.setTo(targetEPR);
+        inOutMEPClient.setTransportInfo(Constants.TRANSPORT_HTTP,
+                Constants.TRANSPORT_HTTP,
+                false);
+        return inOutMEPClient;
+    }
+
+    private SOAPEnvelope createEnvelope(String fileName) throws Exception {
+        if (fileName == "" || fileName == null) {
+            throw new Exception("A SOAP file name must be provided !!");
+        }
+        XMLStreamReader parser = XMLInputFactory.newInstance()
+                .createXMLStreamReader(new FileReader(getTestResourceFile(fileName)));
+
+        return (SOAPEnvelope) new StAXSOAPModelBuilder(parser, null).getDocumentElement();
+    }
+
+    public File getTestResourceFile(String relativePath) {
+        return new File(testResourceDir, relativePath);
+    }
+
+    protected void tearDown() throws Exception {
+        UtilServer.stop();
+    }
+
+}

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/HandlerFailureTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/HandlerFailureTest.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/HandlerFailureTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/HandlerFailureTest.java Fri Jul 29 08:31:15 2005
@@ -50,7 +50,8 @@
 
 
     private static final String ADDRESS = "http://127.0.0.1:" +
-            (UtilServer.TESTING_PORT) +
+            ("5556") +
+//            (UtilServer.TESTING_PORT) +
             "/axis/services/" + SERVICE_NAME + "/" + OPERATION_NAME;
 //    private static final String ADDRESS = "http://127.0.0.1:8080/axis/services/" + SERVICE_NAME;
     private EndpointReference targetEPR = new EndpointReference(ADDRESS);
@@ -60,9 +61,6 @@
     private QName operationName = new QName(OPERATION_NAME);
 
 
-    private MessageContext mc;
-    private Thread thisThread;
-    private SimpleHTTPServer sas;
 
     public HandlerFailureTest() {
         super(HandlerFailureTest.class.getName());

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/util/MyInOutMEPClient.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/util/MyInOutMEPClient.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/engine/util/MyInOutMEPClient.java Fri Jul 29 08:31:15 2005
@@ -1,11 +1,11 @@
 package org.apache.axis2.engine.util;
 
+import org.apache.axis2.AxisFault;
 import org.apache.axis2.clientapi.Call;
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.OperationDescription;
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.AxisFault;
 
 import javax.xml.namespace.QName;
 
@@ -36,17 +36,13 @@
     public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
                                                       OMElement toSend) throws AxisFault {
         OperationDescription axisConfig =
-                serviceContext.getServiceConfig().getOperation(
-                        new QName(axisop));
+                serviceContext.getServiceConfig().getOperation(new QName(axisop));
         if (axisConfig == null) {
             axisConfig = new OperationDescription(new QName(axisop));
-            axisConfig.setRemainingPhasesInFlow(
-                    operationTemplate.getRemainingPhasesInFlow());
+            axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
             axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
-            axisConfig.setPhasesInFaultFlow(
-                    operationTemplate.getPhasesInFaultFlow());
-            axisConfig.setPhasesOutFaultFlow(
-                    operationTemplate.getPhasesOutFaultFlow());
+            axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
+            axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
             serviceContext.getServiceConfig().addOperation(axisConfig);
         }
 
@@ -60,5 +56,37 @@
                 msgctx);
         SOAPEnvelope envelope = responseContext.getEnvelope();
         return envelope;
+    }
+
+
+    public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
+                                                      SOAPEnvelope reqEnvelope) throws AxisFault {
+        OperationDescription axisConfig =
+                serviceContext.getServiceConfig().getOperation(new QName(axisop));
+        if (axisConfig == null) {
+            axisConfig = new OperationDescription(new QName(axisop));
+            axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
+            axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
+            axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
+            axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
+            serviceContext.getServiceConfig().addOperation(axisConfig);
+        }
+
+//        if (axisConfig == null) {
+//            axisConfig = new OperationDescription(new QName(axisop));
+//            serviceContext.getServiceConfig().addOperation(axisConfig);
+//        }
+        MessageContext msgctx = getMessageContext(reqEnvelope);
+
+        MessageContext responseContext = super.invokeBlocking(axisConfig,
+                msgctx);
+        SOAPEnvelope envelope = responseContext.getEnvelope();
+        return envelope;
+    }
+
+    protected MessageContext getMessageContext(SOAPEnvelope envelope) throws AxisFault {
+        MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());
+        msgctx.setEnvelope(envelope);
+        return msgctx;
     }
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPEnvelopeImpl.java Fri Jul 29 08:31:15 2005
@@ -15,15 +15,11 @@
  */
 package org.apache.axis2.soap.impl.llom;
 
-import org.apache.axis2.om.OMConstants;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMException;
-import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.om.OMNode;
-import org.apache.axis2.om.OMXMLParserWrapper;
+import org.apache.axis2.om.*;
 import org.apache.axis2.soap.SOAPBody;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.SOAPHeader;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 
 import javax.xml.namespace.QName;
 
@@ -61,8 +57,15 @@
      * @throws OMException
      */
     public SOAPHeader getHeader() throws OMException {
-        return (SOAPHeader) getFirstChildWithName(
-                new QName(SOAPConstants.HEADER_LOCAL_NAME));
+        return (SOAPHeader) getFirstChildWithName(new QName(SOAPConstants.HEADER_LOCAL_NAME));
+    }
+
+    public void addChild(OMNode child) {
+        if ((child instanceof OMElement) &&!(child instanceof SOAPHeader || child instanceof SOAPBody)) {
+            throw new SOAPProcessingException("SOAP Envelope can not have children other than SOAP Header and Body", SOAP12Constants.FAULT_CODE_SENDER);
+        } else {
+            super.addChild(child);
+        }
     }
 
     /**
@@ -91,12 +94,10 @@
                 element = (OMElement) node;
 
                 if (node != null &&
-                        SOAPConstants.BODY_LOCAL_NAME.equals(
-                                element.getLocalName())) {
+                        SOAPConstants.BODY_LOCAL_NAME.equals(element.getLocalName())) {
                     return (SOAPBody) element;
                 } else {
-                    throw new OMException(
-                            "SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.");
+                    throw new OMException("SOAPEnvelope must contain a body element which is either first or second child element of the SOAPEnvelope.");
                 }
             }
         }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPFaultImpl.java Fri Jul 29 08:31:15 2005
@@ -215,7 +215,7 @@
         if (faultDetail != null) {
             faultDetail.serializeWithCache(omOutput);
         }
-
+       OMSerializerUtil.serializeEndpart(omOutput);
 
     }
 

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPProcessingException.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPProcessingException.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPProcessingException.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPProcessingException.java Fri Jul 29 08:31:15 2005
@@ -1,6 +1,7 @@
 package org.apache.axis2.soap.impl.llom;
 
 import org.apache.axis2.om.OMException;
+import org.apache.axis2.SOAPFaultException;
 
 /**
  * Copyright 2001-2004 The Apache Software Foundation.
@@ -18,7 +19,7 @@
  * the License.
  * <p/>
  */
-public class SOAPProcessingException extends OMException {
+public class SOAPProcessingException extends OMException implements SOAPFaultException{
 
     private String soapFaultCode;
 
@@ -54,11 +55,11 @@
         this.soapFaultCode = faultCode;
     }
 
-    public String getSoapFaultCode() {
+    public String getFaultCode() {
         return soapFaultCode;
     }
 
-    public void setSoapFaultCode(String soapFaultCode) {
+    public void setFaultCode(String soapFaultCode) {
         this.soapFaultCode = soapFaultCode;
     }
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultCodeImpl.java Fri Jul 29 08:31:15 2005
@@ -108,15 +108,15 @@
         writer.writeCharacters(text);
         writer.writeEndElement();
 
-        //serilize siblings
-        if (this.nextSibling != null) {
-            nextSibling.serialize(omOutput);
-        } else if (this.parent != null) {
-            if (!this.parent.isComplete()) {
-                builder.setCache(cache);
-                builder.next();
-            }
-        }
+//        //serilize siblings
+//        if (this.nextSibling != null) {
+//            nextSibling.serialize(omOutput);
+//        } else if (this.parent != null) {
+//            if (!this.parent.isComplete()) {
+//                builder.setCache(cache);
+//                builder.next();
+//            }
+//        }
 
     }
 

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultDetailImpl.java Fri Jul 29 08:31:15 2005
@@ -88,10 +88,10 @@
         }
         writer.writeEndElement();
 
-        //serilize siblings
-        if (this.nextSibling != null) {
-            nextSibling.serialize(omOutput);
-        }
+//        //serilize siblings
+//        if (this.nextSibling != null) {
+//            nextSibling.serialize(omOutput);
+//        }
 
     }
 

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultImpl.java Fri Jul 29 08:31:15 2005
@@ -2,6 +2,7 @@
 
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMXMLParserWrapper;
+import org.apache.axis2.om.impl.llom.OMSerializerUtil;
 import org.apache.axis2.soap.SOAPBody;
 import org.apache.axis2.soap.SOAPFault;
 import org.apache.axis2.soap.SOAPFaultCode;
@@ -61,6 +62,21 @@
 
     public void serializeWithCache(org.apache.axis2.om.impl.OMOutputImpl omOutput) throws XMLStreamException {
         super.serializeWithCache(omOutput);
+//        OMSerializerUtil.serializeStartpart(this, omOutput);
+//        if (getCode() != null) {
+//            getCode().serializeWithCache(omOutput);
+//        }
+//        if (getReason() != null) {
+//            getReason().serializeWithCache(omOutput);
+//        }
+//        if (getReason() != null) {
+//            getReason().serializeWithCache(omOutput);
+//        }
+//
+//        if (getDetail() != null) {
+//            getDetail().serializeWithCache(omOutput);
+//        }
+//        OMSerializerUtil.serializeEndpart(omOutput);
     }
 
     public void serialize(org.apache.axis2.om.impl.OMOutputImpl omOutput) throws XMLStreamException {

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultReasonImpl.java Fri Jul 29 08:31:15 2005
@@ -91,14 +91,14 @@
         writer.writeEndElement();
 
         //serilize siblings
-        if (this.nextSibling != null) {
-            nextSibling.serialize(omOutput);
-        } else if (this.parent != null) {
-            if (!this.parent.isComplete()) {
-                builder.setCache(cache);
-                builder.next();
-            }
-        }
+//        if (this.nextSibling != null) {
+//            nextSibling.serialize(omOutput);
+//        } else if (this.parent != null) {
+//            if (!this.parent.isComplete()) {
+//                builder.setCache(cache);
+//                builder.next();
+//            }
+//        }
 
     }
 

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java?rev=226383&r1=226382&r2=226383&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultRoleImpl.java Fri Jul 29 08:31:15 2005
@@ -75,15 +75,15 @@
         writer.writeCharacters(text);
         writer.writeEndElement();
 
-        //serilize siblings
-        if (this.nextSibling != null) {
-            nextSibling.serialize(omOutput);
-        } else if (this.parent != null) {
-            if (!this.parent.isComplete()) {
-                builder.setCache(cache);
-                builder.next();
-            }
-        }
+//        //serilize siblings
+//        if (this.nextSibling != null) {
+//            nextSibling.serialize(omOutput);
+//        } else if (this.parent != null) {
+//            if (!this.parent.isComplete()) {
+//                builder.setCache(cache);
+//                builder.next();
+//            }
+//        }
 
     }