axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thil...@apache.org
Subject svn commit: r494343 - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/deployment/ src/org/apache/axis2/engine/ src/org/apache/axis2/i18n/ test-resources/deployment/messageFormatterTest/ test/org/apache/axis2/deployment/
Date Tue, 09 Jan 2007 08:49:46 GMT
Author: thilina
Date: Tue Jan  9 00:49:45 2007
New Revision: 494343

URL: http://svn.apache.org/viewvc?view=rev&rev=494343
Log:
Message Formatter configuration using Axis2


Added:
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/axis2.xml
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java
Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=494343&r1=494342&r2=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Tue Jan  9 00:49:45 2007
@@ -145,6 +145,17 @@
                     axisConfig.addMessageBuilder(key, (String) builderSelector.get(key));
                 }
             }
+            
+            // process MessageBuilders
+            OMElement messageFormattersElement = config_element.getFirstChildWithName(new QName(TAG_MESSAGE_FORMATTERS));
+            if (messageFormattersElement != null) {
+                HashMap messageFormatters = processMessageFormatters(messageFormattersElement);
+                Iterator keys = messageFormatters.keySet().iterator();
+                while (keys.hasNext()) {
+                    String key = (String) keys.next();
+                    axisConfig.addMessageBuilder(key, (String) messageFormatters.get(key));
+                }
+            }
 
         } catch (XMLStreamException e) {
             throw new DeploymentException(e);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=494343&r1=494342&r2=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Tue Jan  9 00:49:45 2007
@@ -68,7 +68,8 @@
     String TAG_MESSAGE_BUILDERS = "messageBuilders"; //used to add pluggable support for diffrent wire formats
     String TAG_MESSAGE_BUILDER = "messageBuilder";
     String TAG_CONTENT_TYPE = "contentType";
-
+    String TAG_MESSAGE_FORMATTERS = "messageFormatters"; //used to add pluggable support for diffrent wire formats
+    String TAG_MESSAGE_FORMATTER = "messageFormatter";
 
     String TAG_FLOW_IN = "InFlow";         // inflow start tag
     String TAG_FLOW_OUT = "OutFlow";         // outflow start tag

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java?view=diff&rev=494343&r1=494342&r2=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java Tue Jan  9 00:49:45 2007
@@ -61,4 +61,5 @@
     public static final String TRANSPORT_SENDER_ERROR = "transportSenderError";
     public static final String XML_STREAM_EXCEPTION = "StreamException";
     public static final String ERROR_LOADING_MESSAGE_BUILDER = "errorloadingbuilder";
+    public static final String ERROR_LOADING_MESSAGE_FORMATTER = "errorloadingformatter";
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=494343&r1=494342&r2=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java Tue Jan  9 00:49:45 2007
@@ -216,7 +216,8 @@
 			final OMElement tempMsgBuilder = msgBuilderElement;
 			String builderClassName = null;
 			try {
-				builderClassName = findAndValidateBuilderClass(tempMsgBuilder);
+				builderClassName = findAndValidateSelectorClass(tempMsgBuilder,
+						DeploymentErrorMsgs.ERROR_LOADING_MESSAGE_BUILDER);
 			} catch (PrivilegedActionException e) {
 				throw (DeploymentException) e.getException();
 			}
@@ -227,8 +228,35 @@
 		}
 		return builderSelector;
 	}
+	
+    /**
+	 * Processes the message builders specified in axis2.xml or services.xml.
+	 * 
+	 * @param messageBuildersElement
+	 */
+	protected HashMap processMessageFormatters(OMElement messageFormattersElement)
+			throws DeploymentException {
+		HashMap messageFormatters = new HashMap();
+		Iterator msgFormatters = messageFormattersElement
+				.getChildrenWithName(new QName(TAG_MESSAGE_FORMATTER));
+		while (msgFormatters.hasNext()) {
+			OMElement msgFormatterElement = (OMElement) msgFormatters.next();
+			final OMElement tempMsgFormatter = msgFormatterElement;
+			String formatterClassName = null;
+			try {
+				formatterClassName = findAndValidateSelectorClass(tempMsgFormatter,DeploymentErrorMsgs.ERROR_LOADING_MESSAGE_FORMATTER );
+			} catch (PrivilegedActionException e) {
+				throw (DeploymentException) e.getException();
+			}
+			OMAttribute contentTypeAtt = msgFormatterElement
+					.getAttribute(new QName(TAG_CONTENT_TYPE));
+			messageFormatters.put(contentTypeAtt.getAttributeValue(),
+					formatterClassName);
+		}
+		return messageFormatters;
+	}
 
-	protected String findAndValidateBuilderClass(final OMElement tempMsgBuilder)
+	protected String findAndValidateSelectorClass(final OMElement tempMsgBuilder, final String errorMsg)
 			throws PrivilegedActionException {
 		return (String) org.apache.axis2.java.security.AccessController
 				.doPrivileged(new PrivilegedExceptionAction() {
@@ -237,18 +265,15 @@
 						OMAttribute builderName = tempMsgBuilder
 								.getAttribute(new QName(TAG_CLASS_NAME));
 						String className = builderName.getAttributeValue();
-						StAXBuilder builder = null;
-
 						try {
-							Class builderClass;
-
+							Class selectorClass;
 							if ((className != null) && !"".equals(className)) {
-								builderClass = Loader.loadClass(Thread.currentThread()
+								selectorClass = Loader.loadClass(Thread.currentThread()
 										.getContextClassLoader(), className);
 							}
 						} catch (ClassNotFoundException e) {
 							throw new DeploymentException(
-									Messages.getMessage(DeploymentErrorMsgs.ERROR_LOADING_MESSAGE_BUILDER,
+									Messages.getMessage(errorMsg,
 													"ClassNotFoundException",className), e);
 						}
 						return className;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java?view=diff&rev=494343&r1=494342&r2=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisConfiguration.java Tue Jan  9 00:49:45 2007
@@ -94,6 +94,8 @@
     private HashMap messageReceivers;
     
     private HashMap messageBuilders;
+    
+    private HashMap messageFormatters;
 
     private ClassLoader moduleClassLoader;
 
@@ -126,6 +128,7 @@
         globalModuleList = new ArrayList();
         messageReceivers = new HashMap();
         messageBuilders = new HashMap();
+        messageFormatters = new HashMap();
         outPhases = new ArrayList();
         inFaultPhases = new ArrayList();
         outFaultPhases = new ArrayList();
@@ -150,9 +153,27 @@
         messageReceivers.put(mepURL, messageReceiver);
     }
 
-	public void addMessageBuilder(String mepURL,
+	/**
+	 * Register a messageBuilder implementation against a content type.
+	 * This is used by Axis2 to support different message formats.
+	 * @param contentType
+	 * @param messageBuilder
+	 */
+	public void addMessageBuilder(String contentType,
 			String messageBuilder) {
-		messageBuilders.put(mepURL, messageBuilder);
+		messageBuilders.put(contentType, messageBuilder);
+	}
+	
+
+	/**
+	 * Register a messageFormatter implementation against a content type.
+	 * This is used by Axis2 to support serialization of different message formats.
+	 * @param contentType
+	 * @param messageFormatter
+	 */
+	public void addMessageFormatter(String contentType,
+			String messageFormatter) {
+		messageBuilders.put(contentType, messageFormatter);
 	}
 
     /**
@@ -559,12 +580,21 @@
     }
     
     /**
-     * A user can specify content-type to builder mapping in the Axis2.xml. 
-     * @param contentType
-     * @return the configured builder class name against the given content type.
-     */
+	 * @param contentType
+	 * @return the configured message builder implementation class name against
+	 *         the given content type.
+	 */
     public String getMessageBuilder(String contentType) {
         return (String) messageBuilders.get(contentType);
+    }
+    
+    /**
+	 * @param contentType
+	 * @return the configured message formatter implementation class name
+	 *         against the given content type.
+	 */
+    public String getMessageFormatter(String contentType) {
+        return (String) messageFormatters.get(contentType);
     }
 
     /**

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?view=diff&rev=494343&r1=494342&r2=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Tue Jan  9 00:49:45 2007
@@ -113,6 +113,7 @@
 errorinloadingmr=A {0} error occurred in loading the message receiver {1}
 errorinloadingts=A {0} error occurred in loading the transport sender {1} 
 errorloadingbuilder=A {0} error occurred while validating the message builder {1}
+errorloadingformatter=A {0} error occurred while validating the message formatter {1}
 invalidconfigattribute=Attributes exist in the axis2.xml file that are not valid.  {0} {1}
 undefinedFlowType=An undefined flow type exists {0}
 flowtypeisrequird=The flow type is a required attribute in {0}

Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/axis2.xml?view=auto&rev=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/axis2.xml (added)
+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/axis2.xml Tue Jan  9 00:49:45 2007
@@ -0,0 +1,322 @@
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+ 
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment" locked="false">true</parameter>
+    <parameter name="hotupdate" locked="false">false</parameter>
+    <parameter name="enableMTOM" locked="false">false</parameter>
+    <parameter name="enableSwA" locked="false">false</parameter>
+
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments" locked="false">true</parameter>
+    <parameter name="attachmentDIR" locked="false"></parameter>
+    <parameter name="sizeThreshold" locked="false">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in seconds-->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--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" locked="false">false</parameter>
+
+    <parameter name="userName" locked="false">admin</parameter>
+    <parameter name="password" locked="false">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--<parameter name="ServicesDirectory" locked="false">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory" locked="false">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" locked="false">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush 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>-->
+
+
+    <!--Set the flag to true if you want to enable transport level session mangment-->
+    <parameter name="manageTransportSession" locked="false">false</parameter>
+
+    <!--Following two parameters will be used to handle REST in Axis2. The default settings will make Axis2 to have two-->
+    <!--different endpoints, one for REST (AxisRESTServlet) one for SOAP message handling (AxisServlet). But following-->
+    <!--parameters help to tweak the message handling of two main servlets. -->
+
+    <!-- If the enableRESTInAxis2MainServlet is true, then Axis2MainServlet will handle both SOAP and REST messages -->
+    <parameter name="enableRESTInAxis2MainServlet" locked="true">false</parameter>
+
+    <!-- Following parameter will completely disable REST handling in both the servlets-->
+    <parameter name="disableREST" locked="true">false</parameter>
+
+    <!-- This will disable the separate servlet we have for REST handling. -->
+    <parameter name="disableSeparateEndpointForREST" locked="true">false</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" locked="false">https://someotherhost/context</parameter>-->
+
+
+    <!--    The way of adding listener to the system-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Deafult Message Receiver 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 ovride this for 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"/>
+    </messageReceivers>
+    
+    <!-- ================================================= -->
+    <!-- Message Formatter -->
+    <!-- ================================================= -->
+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
+    <!--formats  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/soap+xml"
+                         class="org.apache.axis2.transport.http.SOAPMessageFormatter"/>
+    </messageBuilders>
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port" locked="false">8080</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 us         (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"                  locked="false">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer"              locked="false">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout"            locked="false">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay"         locked="false">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize"  locked="false">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime"       locked="false">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit"   locked="false">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" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!--Uncomment if you want to have SMTP transport support-->
+    <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
+    <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
+    <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
+    <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
+    <!--</transportReceiver>-->
+
+	<!--Uncomment if you want to have TCP transport support-->
+    <!--transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="false">6060</parameter-->>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncommet following paramter , and set as you required.-->
+        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+    <!-- /transportReceiver -->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>
+    -->
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="false">25</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" locked="false">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or 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="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="PostDispatch"/>
+            </handler>
+        </phase>
+        <!--      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="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml?view=auto&rev=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml (added)
+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/messageFormatterTest/bad-axis2.xml Tue Jan  9 00:49:45 2007
@@ -0,0 +1,323 @@
+<!--
+/*
+ * Copyright 2001-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+ 
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment" locked="false">true</parameter>
+    <parameter name="hotupdate" locked="false">false</parameter>
+    <parameter name="enableMTOM" locked="false">false</parameter>
+    <parameter name="enableSwA" locked="false">false</parameter>
+
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments" locked="false">true</parameter>
+    <parameter name="attachmentDIR" locked="false"></parameter>
+    <parameter name="sizeThreshold" locked="false">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in seconds-->
+    <parameter name="ConfigContextTimeoutInterval" locked="false">30</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults" locked="false">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--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" locked="false">false</parameter>
+
+    <parameter name="userName" locked="false">admin</parameter>
+    <parameter name="password" locked="false">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--<parameter name="ServicesDirectory" locked="false">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory" locked="false">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" locked="false">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush 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>-->
+
+
+    <!--Set the flag to true if you want to enable transport level session mangment-->
+    <parameter name="manageTransportSession" locked="false">false</parameter>
+
+    <!--Following two parameters will be used to handle REST in Axis2. The default settings will make Axis2 to have two-->
+    <!--different endpoints, one for REST (AxisRESTServlet) one for SOAP message handling (AxisServlet). But following-->
+    <!--parameters help to tweak the message handling of two main servlets. -->
+
+    <!-- If the enableRESTInAxis2MainServlet is true, then Axis2MainServlet will handle both SOAP and REST messages -->
+    <parameter name="enableRESTInAxis2MainServlet" locked="true">false</parameter>
+
+    <!-- Following parameter will completely disable REST handling in both the servlets-->
+    <parameter name="disableREST" locked="true">false</parameter>
+
+    <!-- This will disable the separate servlet we have for REST handling. -->
+    <parameter name="disableSeparateEndpointForREST" locked="true">false</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" locked="false">https://someotherhost/context</parameter>-->
+
+
+    <!--    The way of adding listener to the system-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL" locked="false">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Deafult Message Receiver 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 ovride this for 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"/>
+    </messageReceivers>
+    
+    <!-- ================================================= -->
+    <!-- Message Formatter -->
+    <!-- ================================================= -->
+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
+    <!--formats  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/soap+xml"
+                         class="org.apache.axis2.transport.http.FalseMessageFormatter"/>
+    </messageBuilders>
+    
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port" locked="false">8080</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 us         (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"                  locked="false">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer"              locked="false">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout"            locked="false">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay"         locked="false">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize" locked="false">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize"  locked="false">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime"       locked="false">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit"   locked="false">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" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="myQueueConnectionFactory" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+
+        <parameter name="default" locked="false">        	        	
+        	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
+        </parameter>
+    </transportReceiver>-->
+
+    <!--Uncomment if you want to have SMTP transport support-->
+    <!--<transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">-->
+    <!--<parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>-->
+    <!--<parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>-->
+    <!--<parameter name="transport.mail.pop3.port" locked="false">110</parameter>-->
+    <!--<parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>-->
+    <!--</transportReceiver>-->
+
+	<!--Uncomment if you want to have TCP transport support-->
+    <!--transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port" locked="false">6060</parameter-->>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncommet following paramter , and set as you required.-->
+        <!--<parameter name="hostname" locked="false">tcp://myApp.com/ws</parameter>-->
+    <!-- /transportReceiver -->
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+    </transportSender>
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>
+    -->
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+       <parameter name="transport.mail.smtp.port" locked="false">25</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" locked="false">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Transport"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or 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="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="InstanceDispatcher"
+                     class="org.apache.axis2.engine.InstanceDispatcher">
+                <order phase="PostDispatch"/>
+            </handler>
+        </phase>
+        <!--      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="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java?view=auto&rev=494343
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java (added)
+++ webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/MessageFormatterDeploymentTest.java Tue Jan  9 00:49:45 2007
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+package org.apache.axis2.deployment;
+
+import java.io.File;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+
+import org.apache.axis2.AbstractTestCase;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.TransportOutDescription;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.phaseresolver.PhaseException;
+
+public class MessageFormatterDeploymentTest extends AbstractTestCase {
+    /**
+     * Constructor.
+     */
+    public MessageFormatterDeploymentTest(String testName) {
+        super(testName);
+    }
+
+    public void testBuilderSelection() throws AxisFault {
+        String repositoryName  ="target/test-resources/deployment";
+        File repo = new File(repositoryName);
+        String xmlFile = "test-resources/deployment/messageFormatterTest/axis2.xml";
+        File xml = new File(xmlFile);
+        FileSystemConfigurator fsc = new FileSystemConfigurator(repo.getAbsolutePath(), xml.getAbsolutePath());
+        AxisConfiguration axisConfig = fsc.getAxisConfiguration();
+        String className = axisConfig.getMessageBuilder("application/soap+xml");
+        assertEquals(className,"org.apache.axis2.transport.http.SOAPMessageFormatter");
+    }
+    
+    public void testBuilderSelectionInvalidEntry() {
+        String repositoryName  ="target/test-resources/deployment";
+        File repo = new File(repositoryName);
+        String xmlFile = "test-resources/deployment/messageFormatterTest/bad-axis2.xml";
+        File xml = new File(xmlFile);
+        FileSystemConfigurator fsc = new FileSystemConfigurator(repo.getAbsolutePath(), xml.getAbsolutePath());
+        AxisFault testFault=null;
+        try {
+			fsc.getAxisConfiguration();
+		} catch (AxisFault e) {
+			testFault = e;
+		}
+		assertNotNull(testFault);
+    }
+}



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message