You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@synapse.apache.org by hi...@apache.org on 2011/12/07 13:17:12 UTC

svn commit: r1211407 [3/7] - in /synapse/trunk/java/modules/integration: ./ src/ src/test/ src/test/java/ src/test/java/org/ src/test/java/org/apache/ src/test/java/org/apache/synapse/ src/test/java/org/apache/synapse/samples/ src/test/java/org/apache/...

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteSampleClient.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteSampleClient.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteSampleClient.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/clients/StockQuoteSampleClient.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,491 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.clients;
+
+import org.apache.axiom.om.*;
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.soap.SOAPBody;
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.client.OperationClient;
+import org.apache.axis2.client.Options;
+import org.apache.axis2.client.ServiceClient;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.transport.http.HTTPConstants;
+import org.apache.axis2.transport.http.HttpTransportProperties;
+import org.apache.axis2.wsdl.WSDLConstants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.neethi.Policy;
+import org.apache.neethi.PolicyEngine;
+import org.apache.rampart.RampartMessageData;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SampleConfiguration;
+
+import javax.xml.namespace.QName;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Random;
+
+public class StockQuoteSampleClient {
+
+    private static final Log log = LogFactory.getLog(StockQuoteSampleClient.class);
+
+    private final static String COOKIE = "Cookie";
+    private final static String SET_COOKIE = "Set-Cookie";
+    private ConfigurationContext configContext = null;
+
+    private Options options;
+    private ServiceClient serviceClient;
+    private SampleClientResult clientResult;
+    private OMElement payload;
+    private OMElement response;
+    private boolean completed;
+    private SampleConfiguration.ClientSampleConfiguration configuration;
+
+    public StockQuoteSampleClient(SampleConfiguration.ClientSampleConfiguration configuration) {
+        this.configuration = configuration;
+    }
+
+    private void initializeClient(String addUrl, String trpUrl, String prxUrl,
+                                  String svcPolicy, long timeout) throws Exception {
+        log.info("initialing client config...");
+        options = new Options();
+        clientResult = new SampleClientResult();
+        clientResult.setGotResponse(false);
+        payload = null;
+
+        log.info("creating axis2 configuration context using the repo: " + configuration.getClientRepo());
+
+        configContext = ConfigurationContextFactory.
+                createConfigurationContextFromFileSystem(configuration.getClientRepo(),
+                        configuration.getAxis2Xml());
+        serviceClient = new ServiceClient(configContext, null);
+
+        log.info("setting address, transport, proxy urls where applicable");
+        if (addUrl != null && !"null".equals(addUrl)) {
+            serviceClient.engageModule("addressing");
+            options.setTo(new EndpointReference(addUrl));
+        }
+        if (trpUrl != null && !"null".equals(trpUrl)) {
+            options.setProperty(Constants.Configuration.TRANSPORT_URL, trpUrl);
+        }
+
+        if (prxUrl != null && !"null".equals(prxUrl)) {
+            HttpTransportProperties.ProxyProperties proxyProperties =
+                    new HttpTransportProperties.ProxyProperties();
+            URL url = new URL(prxUrl);
+            proxyProperties.setProxyName(url.getHost());
+            proxyProperties.setProxyPort(url.getPort());
+            proxyProperties.setUserName("");
+            proxyProperties.setPassWord("");
+            proxyProperties.setDomain("");
+            options.setProperty(HTTPConstants.PROXY, proxyProperties);
+        }
+
+        // apply any service policies if any
+        if (svcPolicy != null && !"null".equals(svcPolicy) && svcPolicy.length() > 0) {
+            log.info("Using WS-Security");
+            serviceClient.engageModule("addressing");
+            serviceClient.engageModule("rampart");
+            StAXOMBuilder builder = new StAXOMBuilder(svcPolicy);
+            Policy policy = PolicyEngine.getPolicy(builder.getDocumentElement());
+            options.setProperty(
+                    RampartMessageData.KEY_RAMPART_POLICY, policy);
+        }
+
+        if (timeout > 0) {
+            log.info("setting client timeout to: " + timeout);
+            options.setTimeOutInMilliSeconds(timeout);
+        }
+
+        serviceClient.setOptions(options);
+    }
+
+    private void deInitializeClient() {
+        if (serviceClient != null) {
+            try {
+                log.info("cleaning up client");
+                serviceClient.cleanup();
+                configContext.terminate();
+            } catch (AxisFault axisFault) {
+                log.error("Error terminating client", axisFault);
+            }
+        }
+    }
+
+    public SampleClientResult requestStandardQuote(String addUrl, String trpUrl, String prxUrl,
+                                                   String symbol, String svcPolicy) {
+        log.info("sending standard quote request");
+        try {
+            initializeClient(addUrl, trpUrl, prxUrl, svcPolicy, 10000);
+
+            payload = StockQuoteHandler.createStandardQuoteRequest(
+                    symbol, 1);
+            options.setAction("urn:getQuote");
+            OMElement resultElement = serviceClient.sendReceive(payload);
+            log.info("Standard :: Stock price = $" +
+                    StockQuoteHandler.parseStandardQuoteResponse(resultElement));
+            clientResult.setGotResponse(true);
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setGotResponse(false);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+
+    }
+
+    public SampleClientResult requestDualQuote(String addUrl, String trpUrl,
+                                               String prxUrl, String symbol) {
+        log.info("sending dual quote request");
+
+        try {
+            initializeClient(addUrl, trpUrl, prxUrl, null, 10000);
+
+            payload = StockQuoteHandler.createStandardQuoteRequest(
+                    symbol, 1);
+            options.setAction("urn:getQuote");
+            //serviceClient.engageModule("addressing");
+            setCompleted(false);
+            serviceClient.sendReceiveNonBlocking(payload, new StockQuoteCallback(this));
+
+            while (true) {
+                if (isCompleted()) {
+                    log.info("Standard dual channel :: Stock price = $" +
+                            StockQuoteHandler.parseStandardQuoteResponse(getResponse()));
+                    clientResult.setGotResponse(true);
+                    break;
+                } else {
+                    Thread.sleep(100);
+                }
+            }
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setGotResponse(false);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+    }
+
+    public SampleClientResult requestCustomQuote(String addUrl, String trpUrl,
+                                                 String prxUrl, String symbol) {
+        log.info("sending custom quote request");
+
+        try {
+            initializeClient(addUrl, trpUrl, prxUrl, null, 10000);
+
+            payload = StockQuoteHandler.createCustomQuoteRequest(symbol);
+            options.setAction("urn:getQuote");
+            OMElement resultElement = serviceClient.sendReceive(payload);
+            log.info("Custom :: Stock price = $" +
+                    StockQuoteHandler.parseCustomQuoteResponse(resultElement));
+            clientResult.setGotResponse(true);
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setGotResponse(false);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+    }
+
+    public SampleClientResult placeOrder(String addUrl, String trpUrl, String prxUrl, String symbol) {
+        log.info("sending fire and forget (place order) request");
+
+        try {
+
+            initializeClient(addUrl, trpUrl, prxUrl, null, 10000);
+            double price = getRandom(100, 0.9, true);
+            int quantity = (int) getRandom(10000, 1.0, true);
+            payload = StockQuoteHandler.createPlaceOrderRequest(price, quantity, symbol);
+            options.setAction("urn:placeOrder");
+
+            serviceClient.fireAndForget(payload);
+            Thread.sleep(5000);
+
+            log.info("Order placed for " + quantity
+                    + " shares of stock " + symbol
+                    + " at a price of $ " + price);
+            clientResult.setGotResponse(true);
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setGotResponse(false);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+    }
+
+    public SampleClientResult requestRestQuote(String addUrl, String trpUrl,
+                                               String prxUrl, String symbol) {
+        log.info("sending rest request");
+
+        try {
+            initializeClient(addUrl, trpUrl, prxUrl, null, 10000);
+
+            payload = StockQuoteHandler.createStandardQuoteRequest(
+                    symbol, 1);
+            options.setAction("urn:getQuote");
+            options.setProperty(Constants.Configuration.ENABLE_REST, Constants.VALUE_TRUE);
+            OMElement resultElement = serviceClient.sendReceive(payload);
+            log.info("Standard :: Stock price = $" +
+                    StockQuoteHandler.parseStandardQuoteResponse(resultElement));
+            clientResult.setGotResponse(true);
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setGotResponse(false);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+
+    }
+
+
+    public SampleClientResult sessionlessClient(String addUrl, String trpUrl, int iterations) {
+        try {
+            boolean infinite = iterations <= 0;
+            OMFactory fac = OMAbstractFactory.getOMFactory();
+            OMElement value = fac.createOMElement("Value", null);
+            value.setText("Sample string");
+
+            initializeClient(addUrl, trpUrl, null, null, 10000);
+
+            options.setAction("urn:sampleOperation");
+
+
+            String testString = "";
+
+            long i = 0;
+            while (i < iterations || infinite) {
+                serviceClient.getOptions().setManageSession(true);
+                OMElement responseElement = serviceClient.sendReceive(value);
+                String response = responseElement.getText();
+
+                if (!clientResult.gotResponse()) {
+                    clientResult.setGotResponse(true);
+                }
+
+                i++;
+                log.info("Request: " + i + " ==> " + response);
+                testString = testString.concat(":" + i + ">" + response + ":");
+            }
+
+            clientResult.setFinished(true);
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setFinished(true);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+    }
+
+    public SampleClientResult statefulClient(String addUrl, String trpUrl, int iterations) {
+        boolean infinite = false;
+        String session = null;
+
+        clientResult = new SampleClientResult();
+        clientResult.setGotResponse(false);
+
+        try {
+
+            SOAPEnvelope env1 = buildSoapEnvelope("c1", "v1");
+            SOAPEnvelope env2 = buildSoapEnvelope("c2", "v1");
+            SOAPEnvelope env3 = buildSoapEnvelope("c3", "v1");
+            SOAPEnvelope[] envelopes = {env1, env2, env3};
+
+            initializeClient(addUrl, trpUrl, null, null, 10000);
+
+            options.setAction("urn:sampleOperation");
+
+            int i = 0;
+            int sessionNumber;
+            String[] cookies = new String[3];
+            boolean httpSession = session != null && "http".equals(session);
+            int cookieNumber;
+            while (i < iterations || infinite) {
+                i++;
+                MessageContext messageContext = new MessageContext();
+                sessionNumber = getSessionTurn(envelopes.length);
+
+                messageContext.setEnvelope(envelopes[sessionNumber]);
+                cookieNumber = getSessionTurn(cookies.length);
+                String cookie = cookies[cookieNumber];
+                if (httpSession) {
+                    setSessionID(messageContext, cookie);
+                }
+                try {
+                    OperationClient op = serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
+                    op.addMessageContext(messageContext);
+                    op.execute(true);
+
+                    MessageContext responseContext =
+                            op.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
+                    String receivedCookie = extractSessionID(responseContext);
+                    String receivedSetCookie = getSetCookieHeader(responseContext);
+                    if (httpSession) {
+
+                        if (receivedSetCookie != null && !"".equals(receivedSetCookie)) {
+                            cookies[cookieNumber] = receivedCookie;
+                        }
+                    }
+
+                    SOAPEnvelope responseEnvelope = responseContext.getEnvelope();
+
+                    OMElement vElement =
+                            responseEnvelope.getBody().getFirstChildWithName(new QName("Value"));
+
+                    if (!clientResult.gotResponse()) {
+                        clientResult.setGotResponse(true);
+                    }
+
+                    log.info("Request: " + i + " with Session ID: " +
+                                    (httpSession ? cookie : sessionNumber) + " ---- " +
+                                    "Response : with  " + (httpSession && receivedCookie != null ?
+                                    (receivedSetCookie != null ? receivedSetCookie :
+                                            receivedCookie) : " ") + " " + vElement.getText());
+                } catch (AxisFault axisFault) {
+                    log.error("Request with session id " +
+                            (httpSession ? cookie : sessionNumber) + " " +
+                            "- Get a Fault : " + axisFault.getMessage(), axisFault);
+                }
+            }
+
+            clientResult.setFinished(true);
+        } catch (Exception e) {
+            log.error("Error invoking service", e);
+            clientResult.setFinished(true);
+            clientResult.setException(e);
+        }
+        deInitializeClient();
+
+        return clientResult;
+    }
+
+
+    private int getSessionTurn(int max) {
+        Random random = new Random();
+        return random.nextInt(max);
+    }
+
+    protected String getSetCookieHeader(MessageContext axis2MessageContext) {
+
+        Object o = axis2MessageContext.getProperty(MessageContext.TRANSPORT_HEADERS);
+
+        if (o != null && o instanceof Map) {
+            Map headerMap = (Map) o;
+            return (String) headerMap.get(SET_COOKIE);
+        }
+        return null;
+    }
+
+    protected void setSessionID(MessageContext axis2MessageContext, String value) {
+
+        if (value == null) {
+            return;
+        }
+        Map map = (Map) axis2MessageContext.getProperty(HTTPConstants.HTTP_HEADERS);
+        if (map == null) {
+            map = new HashMap();
+            axis2MessageContext.setProperty(HTTPConstants.HTTP_HEADERS, map);
+        }
+        map.put(COOKIE, value);
+    }
+
+    protected String extractSessionID(MessageContext axis2MessageContext) {
+
+        Object o = axis2MessageContext.getProperty(MessageContext.TRANSPORT_HEADERS);
+
+        if (o != null && o instanceof Map) {
+            Map headerMap = (Map) o;
+            String cookie = (String) headerMap.get(SET_COOKIE);
+            if (cookie == null) {
+                cookie = (String) headerMap.get(COOKIE);
+            } else {
+                cookie = cookie.split(";")[0];
+            }
+            return cookie;
+        }
+        return null;
+    }
+
+    private SOAPEnvelope buildSoapEnvelope(String clientID, String value) {
+        SOAPFactory soapFactory = OMAbstractFactory.getSOAP12Factory();
+
+        SOAPEnvelope envelope = soapFactory.createSOAPEnvelope();
+
+        SOAPHeader header = soapFactory.createSOAPHeader();
+        envelope.addChild(header);
+
+        OMNamespace synNamespace = soapFactory.
+                createOMNamespace("http://ws.apache.org/ns/synapse", "syn");
+        OMElement clientIDElement = soapFactory.createOMElement("ClientID", synNamespace);
+        clientIDElement.setText(clientID);
+        header.addChild(clientIDElement);
+
+        SOAPBody body = soapFactory.createSOAPBody();
+        envelope.addChild(body);
+
+        OMElement valueElement = soapFactory.createOMElement("Value", null);
+        valueElement.setText(value);
+        body.addChild(valueElement);
+
+        return envelope;
+    }
+
+
+    private double getRandom(double base, double varience, boolean onlypositive) {
+        double rand = Math.random();
+        return (base + ((rand > 0.5 ? 1 : -1) * varience * base * rand))
+                * (onlypositive ? 1 : (rand > 0.5 ? 1 : -1));
+    }
+
+    public boolean isCompleted() {
+        return completed;
+    }
+
+    public void setCompleted(boolean completed) {
+        this.completed = completed;
+    }
+
+    public OMElement getResponse() {
+        return response;
+    }
+
+    public void setResponse(OMElement response) {
+        this.response = response;
+    }
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample0.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample0.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample0.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample0.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,58 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample0 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample0.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample0() {
+        super(0);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testSmartClientMode() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Smart Client mode");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+
+    public void testSynapseAsHTTPProxy() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String prxUrl = "http://localhost:8280/";
+
+        log.info("Running test: Using Synapse as a HTTP Proxy");
+        result = client.requestStandardQuote(addUrl, null, prxUrl, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample1.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample1.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample1.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample1.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample1 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample1.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample1() {
+        super(1);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testDumbClientMode() {
+        String trpUrl = "http://localhost:8280/services/StockQuote";
+
+        log.info("Running test: Dumb Client mode");
+        result = client.requestStandardQuote(null, trpUrl, null, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample10.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample10.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample10.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample10.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample10 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample10.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample10() {
+        super(10);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testDynamicEndPoints() {
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Dynamic EndPoints with Registry");
+        result = client.requestStandardQuote(null, trpUrl, null, "IBM", null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample11.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample11.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample11.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample11.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample11 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample11.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample11() {
+        super(11);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testFullRegistryBasedConfig() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280";
+
+        log.info("Running test: Local Registry entry definitions, reusable endpoints and sequences");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM",null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample12.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample12.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample12.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample12.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample12 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample12.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample12() {
+        super(12);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testFireAndForget() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: One way messaging / fireAndForget through Synapse");
+        result = client.placeOrder(addUrl, trpUrl, null, "IBM");
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample13.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample13.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample13.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample13.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample13 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample13.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample13() {
+        super(13);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testDualQuote() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Dual channel invocation through Synapse");
+        result = client.requestDualQuote(addUrl, trpUrl, null, "IBM");
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample15.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample15.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample15.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample15.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample15 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample15.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample15() {
+        super(15);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testMessageEnrichment() {
+        String trpUrl = "http://localhost:8280/services/StockQuote";
+
+        log.info("Running test: Message Enrichment through Synapse");
+        result = client.requestStandardQuote(null, trpUrl, null, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample16.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample16.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample16.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample16.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample16 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample16.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample16() {
+        super(16);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testDynamicStaticKeys() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Introduction to dynamic and static keys ");
+        result = client.requestCustomQuote(addUrl, trpUrl, null, "IBM");
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample2.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample2.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample2.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample2.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,50 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample2 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample2.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample2() {
+        super(2);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testCBR() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280";
+
+        log.info("Running test: CBR with the Switch-case mediator, using message properties");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "MSFT" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample3.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample3.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample3.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample3.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample3 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample3.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample3() {
+        super(3);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testLocalEntriesReusableEndPointsSequences() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280";
+
+        log.info("Running test: Local Registry entry definitions, reusable endpoints and sequences");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample4.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample4.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample4.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample4.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,61 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample4 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample4.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample4() {
+        super(4);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testErrorHandling() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280";
+
+        log.info("Running test: Introduction to error handling");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
+        assertTrue("Did not get the correct response", result.gotResponse());
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "MSFT" ,null);
+        assertFalse("Must not get a response", result.gotResponse());
+        Exception resultEx = result.getException();
+        assertNotNull("Did not receive expected error" , resultEx);
+        log.info("Got an error as expected: " + resultEx.getMessage());
+        assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "SUN" ,null);
+        assertFalse("Must not get a response", result.gotResponse());
+        Exception resultEx2 = result.getException();
+        assertNotNull("Did not receive expected error" , resultEx);
+        log.info("Got an error as expected: " + resultEx.getMessage());
+        assertTrue("Did not receive expected error", resultEx2 instanceof AxisFault);
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample5.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample5.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample5.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample5.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,73 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample5 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample5.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample5() {
+        super(5);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testCreateFaultAndChangeDirection() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280";
+        String expectedError_MSFT = "bogus";
+        String expectedError_SUN = "Connection refused";
+        String expectedError_IBM = "The input stream for an incoming message is null";
+
+        log.info("Running test: Creating SOAP fault messages and changing the direction of a message");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "MSFT" ,null);
+        assertFalse("Must not get a response", result.gotResponse());
+        Exception resultEx = result.getException();
+        assertNotNull("Did not receive expected error", resultEx);
+        log.info("Got an error as expected: " + resultEx.getMessage());
+        assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
+        assertTrue("Did not receive expected error", resultEx.getMessage().indexOf(expectedError_MSFT)!=-1);
+
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "SUN" ,null);
+        assertFalse("Must not get a response", result.gotResponse());
+        resultEx = result.getException();
+        assertNotNull("Did not receive expected error", resultEx);
+        log.info("Got an error as expected: " + resultEx.getMessage());
+        assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
+        assertTrue("Did not receive expected error", resultEx.getMessage().indexOf(expectedError_SUN)!=-1);
+
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
+        assertFalse("Must not get a response", result.gotResponse());
+        resultEx = result.getException();
+        assertNotNull("Did not receive expected error", resultEx);
+        log.info("Got an error as expected: " + resultEx.getMessage());
+        assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample6.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample6.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample6.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample6.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,47 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample6 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample6.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample6() {
+        super(6);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testManipulatingHeadersAndFiltering() {
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Dumb Client mode  ");
+        result = client.requestStandardQuote(null, trpUrl, null, null ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample7.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample7.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample7.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample7.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,56 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample7 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample7.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample7() {
+        super(7);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testLocalRegEntriesAndSchemaValidation() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280";
+        String expectedError = "Invalid custom quote request";
+
+        log.info("Running test: Creating SOAP fault messages and changing the direction of a message");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM",null);
+        assertFalse("Should not get a response", result.gotResponse());
+        Exception resultEx = result.getException();
+        assertNotNull("Did not receive expected error", resultEx);
+        log.info("Got an error as expected: " + resultEx.getMessage());
+        assertTrue("Did not receive expected error", resultEx instanceof AxisFault);
+        assertTrue("Did not receive expected error", resultEx.getMessage().indexOf(expectedError)!=-1);
+
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample8.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample8.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample8.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample8.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample8 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample8.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample8() {
+        super(8);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testRegistryAndXSLTMediator() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Introduction to static and dynamic registry resources, and using XSLT transformations  ");
+        result = client.requestCustomQuote(addUrl, trpUrl, null, "IBM");
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample9.java
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample9.java?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample9.java (added)
+++ synapse/trunk/java/modules/integration/src/test/java/org/apache/synapse/samples/framework/tests/message/Sample9.java Wed Dec  7 12:17:10 2011
@@ -0,0 +1,48 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.
+ */
+package org.apache.synapse.samples.framework.tests.message;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.samples.framework.SampleClientResult;
+import org.apache.synapse.samples.framework.SynapseTestCase;
+import org.apache.synapse.samples.framework.clients.StockQuoteSampleClient;
+
+public class Sample9 extends SynapseTestCase {
+
+    private static final Log log = LogFactory.getLog(Sample9.class);
+    SampleClientResult result;
+    StockQuoteSampleClient client;
+
+    public Sample9() {
+        super(9);
+        client = getStockQuoteClient();
+    }
+
+
+    public void testDynamicSequences() {
+        String addUrl = "http://localhost:9000/services/SimpleStockQuoteService";
+        String trpUrl = "http://localhost:8280/";
+
+        log.info("Running test: Dynamic Sequences with Registry");
+        result = client.requestStandardQuote(addUrl, trpUrl, null, "IBM" ,null);
+        assertTrue("Client did not get run successfully ", result.gotResponse());
+    }
+
+}

Added: synapse/trunk/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml
URL: http://svn.apache.org/viewvc/synapse/trunk/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml?rev=1211407&view=auto
==============================================================================
--- synapse/trunk/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml (added)
+++ synapse/trunk/java/modules/integration/src/test/resources/axis2Xml/axis2Client/axis2_def.xml Wed Dec  7 12:17:10 2011
@@ -0,0 +1,356 @@
+<!--
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you 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.
+  -->
+
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment">true</parameter>
+    <parameter name="hotupdate">false</parameter>
+    <parameter name="enableMTOM">false</parameter>
+    <parameter name="enableSwA">false</parameter>
+
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments">true</parameter>
+    <parameter name="attachmentDIR"></parameter>
+    <parameter name="sizeThreshold">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in milliseconds-->
+    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behavior.-->
+    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the exception-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set, then Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+    <parameter name="userName">admin</parameter>
+    <parameter name="password">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--ServicesDirectory only works on the following cases-->
+    <!---File based configurator and in that case the value should be a file URL (http:// not allowed)-->
+    <!---When creating URL Based configurator with URL "file://"  -->
+    <!--- War based configurator with expanded case , -->
+
+    <!--All the other scenarios it will be ignored.-->
+    <!--<parameter name="ServicesDirectory">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
+
+
+
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distinguiush those endpoints-->
+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+    <!--context path to proper Axis2 servlets-->
+    <parameter name="servicePath" locked="false">services</parameter>
+    <parameter name="restPath" locked="false">rest</parameter>
+
+    <!-- Following parameter will completely disable REST handling in Axis2-->
+    <parameter name="disableREST" locked="true">false</parameter>
+
+    <!--POJO deployer , this will alow users to drop .class file and make that into a service-->
+    <deployer extension=".class" directory="pojo" class="org.apache.axis2.deployment.POJODeployer"/>
+
+    <!-- Following parameter will set the host name for the epr-->
+    <!--<parameter name="hostname" locked="true">myhost.com</parameter>-->
+
+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
+    <!-- use this parameter to override autodetected url -->
+    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
+
+
+    <!--    The way of adding listener to the system-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the deafult MessageReceiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can ovrride this for a particular service by adding the same element with your requirement-->
+    <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+    </messageReceivers>
+
+    <!-- ================================================= -->
+    <!-- Message Formatter -->
+    <!-- ================================================= -->
+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageFormatters>
+        <messageFormatter contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+        <messageFormatter contentType="multipart/form-data"
+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+        <messageFormatter contentType="application/xml"
+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+    </messageFormatters>
+
+    <!-- ================================================= -->
+    <!-- Message Builders -->
+    <!-- ================================================= -->
+    <!--Following content type to builder mapping can be used to implement support for different message -->
+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/xml"
+                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+        <messageBuilder contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+        <messageBuilder contentType="multipart/form-data"
+                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
+    </messageBuilders>
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+	<transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port">8200</parameter>
+        <!-- Here is the complete list of supported parameters (see example settings further below):
+            port: the port to listen on (default 6060)
+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
+                                false to minimize bandwidth consumption by combining segments
+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills up         (default 150)
+                                       note that default queue never fills up:  see HttpFactory
+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
+                                  note that no such threads can exist with default unbounded request queue
+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
+        -->
+        <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter>            -->
+    </transportReceiver>
+
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
+        <parameter name="myTopicConnectionFactory">
+        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName">TopicConnectionFactory</parameter>
+		<parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory">
+        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
+        </parameter>
+
+        <parameter name="default">
+        	<parameter name="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url">tcp://localhost:61616</parameter>
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName">QueueConnectionFactory</parameter>
+		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!--transportReceiver name="mailto" class="org.apache.axis2.transport.mail.MailTransportListener">
+    </transportReceiver-->
+
+    <!--transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port">6060</parameter>
+    </transportReceiver-->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <!--transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="udp"
+                     class="org.apache.axis2.transport.udp.UDPSender"/-->
+    <!--transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/ -->
+	<transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+
+        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
+        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
+    </transportSender>
+
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+    </transportSender>
+    <!--transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/-->
+
+    <!-- configure the SMTP server information
+    check com.sun.mail.smtp package documentation for descriptions of properties-->
+    <!--transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+        <parameter name="mail.smtp.host">smtp.gmail.com</parameter>
+        <parameter name="mail.smtp.port">587</parameter>
+        <parameter name="mail.smtp.starttls.enable">true</parameter>
+        <parameter name="mail.smtp.auth">true</parameter>
+        <parameter name="mail.smtp.user">synapse.demo.0</parameter>
+        <parameter name="mail.smtp.password">mailpassword</parameter>
+        <parameter name="mail.smtp.from">synapse.demo.0@gmail.com</parameter>
+    </transportSender-->
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Comment this to disable Addressing -->
+    <module ref="addressing"/>
+
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <!--<moduleConfig name="addressing">-->
+    <!--<parameter name="addressingPara">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Clustering  -->
+    <!-- ================================================= -->
+    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
+    <!--
+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
+        <parameter name="param1">value1</parameter>
+        <parameter name="domain">apache.axis2.domain</parameter>
+    	<configurationManager class="org.apache.axis2.cluster.configuration.TribesConfigurationManager">
+    	    <listener class="org.apache.axis2.cluster.configuration.DefaultConfigurationManagerListener"/>
+    	</configurationManager>
+    	<contextManager class="org.apache.axis2.cluster.context.TribesContextManager">
+    	    <listener class="org.apache.axis2.cluster.context.DefaultContextManagerListener"/>
+    	</contextManager>
+    </cluster>
+     -->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Addressing">
+             <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                 <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--  System predefined phases       -->
+        <!--   After Postdispatch phase module author or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+        <phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="soapmonitorPhase"/>
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="Addressing">
+             <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                 <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+        <phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="soapmonitorPhase"/>
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+</axisconfig>