axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From barre...@apache.org
Subject svn commit: r557104 - in /webservices/axis2/trunk/java/modules: jaxws/ jaxws/test-resources/ jaxws/test/org/apache/axis2/jaxws/framework/ jaxws/test/org/apache/axis2/jaxws/provider/ jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/ jaxws/test/org/a...
Date Wed, 18 Jul 2007 00:49:47 GMT
Author: barrettj
Date: Tue Jul 17 17:49:46 2007
New Revision: 557104

URL: http://svn.apache.org/viewvc?view=rev&rev=557104
Log:
AXIS2-2853
AxisEngine check of mustUnderstand headers on client inbound messages; testcase to verify mustUndertand processing on requests and responses and to verify using a handler to mark understood headers as processed.

Added:
    webservices/axis2/trunk/java/modules/jaxws/test-resources/axis2.xml
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderChecker.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/MANIFEST.MF
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/ProviderSOAPMessage.wsdl
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/services.xml
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/SoapMessageMUProvider.java
Modified:
    webservices/axis2/trunk/java/modules/jaxws/pom.xml
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
    webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java

Modified: webservices/axis2/trunk/java/modules/jaxws/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/pom.xml?view=diff&rev=557104&r1=557103&r2=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/pom.xml (original)
+++ webservices/axis2/trunk/java/modules/jaxws/pom.xml Tue Jul 17 17:49:46 2007
@@ -465,6 +465,17 @@
 										<include name="org/apache/axis2/jaxws/server/**"/>
 									</fileset>
 								</copy>
+                                <copy toDir="target/test-classes/services/SoapMessageMUProviderService/">
+                                    <fileset dir="target/test-classes">
+                                        <include name="org/apache/axis2/jaxws/provider/soapmsgmu/**"/>
+                                    </fileset>
+                                    <fileset dir="test/org/apache/axis2/jaxws/provider/soapmsgmu">
+                                        <include name="META-INF/**"/>
+                                    </fileset>
+                                    <fileset dir="target/classes">
+                                        <include name="org/apache/axis2/jaxws/server/**"/>
+                                    </fileset>
+                                </copy>
 								<copy toDir="target/test-classes/services/JAXBProviderService/">
 									<fileset dir="target/test-classes">
 										<include name="org/apache/axis2/jaxws/provider/jaxb/**"/>
@@ -806,6 +817,7 @@
 								<copy toDir="target/test-classes/">
 									<fileset dir="test-resources/">
 										<include name="**/*.properties"/>
+										<include name="**/axis2.xml"/>
 									</fileset>
 								</copy>
 							</tasks>
@@ -866,6 +878,11 @@
 						<property>
 							<name>javax.xml.soap.MetaFactory</name>
 							<value>org.apache.axis2.saaj.SAAJMetaFactoryImpl</value>
+						</property>
+                        <!-- Need this for the client side to pickup an axis2.xml to configure SoapMessageMUProviderChecker -->
+						<property>
+						    <name>org.apache.axis2.jaxws.config.path</name>
+						    <value>./target/test-classes/axis2.xml</value>
 						</property>
 					</systemProperties>
 				</configuration>

Added: webservices/axis2/trunk/java/modules/jaxws/test-resources/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test-resources/axis2.xml?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test-resources/axis2.xml (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test-resources/axis2.xml Tue Jul 17 17:49:46 2007
@@ -0,0 +1,283 @@
+<!--
+  ~ 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>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults">true</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>
+
+    <!--This is the user name and password of admin console-->
+    <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 distinguish those endpoints-->
+    <!--<parameter name="servicePath">services</parameter>-->
+    <!--<parameter name="restPath">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>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Default 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 override 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"/>
+        <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"/>
+        <!--Left commented because it adds the depandancy of servlet-api to other modules.
+        Please uncomment to Receive messages in multipart/form-data format-->
+        <!--<messageBuilder contentType="multipart/form-data"-->
+                         <!--class="org.apache.axis2.builder.MultipartFormDataBuilder"/>-->
+    </messageBuilders>
+
+    <!-- ================================================= -->
+    <!-- Target Resolvers -->
+    <!-- ================================================= -->
+    <!-- Uncomment the following and specify the class name for your TargetResolver to add -->
+    <!-- a TargetResolver. TargetResolvers are used to process the To EPR for example to -->
+    <!-- choose a server in a cluster -->
+    <!--<targetResolvers>-->
+    <!--<targetResolver class="" />-->
+    <!--</targetResolvers>-->
+
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port">6060</parameter>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncomment following parameter , and set as you required.-->
+        <!--<parameter name="hostname">http://myApp.com/ws</parameter>-->
+    </transportReceiver>
+
+    <transportReceiver name="tcp"
+                       class="org.apache.axis2.transport.tcp.TCPServer">
+        <parameter name="port">6061</parameter>
+        <!--If you want to give your own host address for EPR generation-->
+        <!--uncomment following parameter , and set as you required.-->
+        <!--<parameter name="hostname">tcp://myApp.com/ws</parameter>-->
+    </transportReceiver>
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <!--<transportSender name="jms"-->
+                     <!--class="org.apache.axis2.transport.jms.JMSSender"/>-->
+    <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">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</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>
+
+    <!-- ================================================= -->
+    <!-- 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="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase">
+            <handler name="SoapMessageMUProviderChecker"
+                     class="org.apache.axis2.jaxws.provider.SoapMessageMUProviderChecker">
+                <order phase="OperationInPhase"/>
+            </handler>
+        </phase>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+        <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="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher">
+                <order phase="Dispatch"/>
+            </handler>
+        </phase>
+        <phase name="RMPhase"/>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInPhase">
+            <handler name="SoapMessageMUProviderChecker"
+                     class="org.apache.axis2.jaxws.provider.SoapMessageMUProviderChecker">
+                <order phase="OperationInPhase"/>
+            </handler>
+        </phase>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="RMPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
\ No newline at end of file

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java?view=diff&rev=557104&r1=557103&r2=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/framework/JAXWSTest.java Tue Jul 17 17:49:46 2007
@@ -58,6 +58,7 @@
 import org.apache.axis2.jaxws.provider.JAXBProviderTests;
 import org.apache.axis2.jaxws.provider.SOAPFaultProviderTests;
 import org.apache.axis2.jaxws.provider.SoapMessageProviderTests;
+import org.apache.axis2.jaxws.provider.SoapMessageMUProviderTests;
 import org.apache.axis2.jaxws.provider.SourceMessageProviderTests;
 import org.apache.axis2.jaxws.provider.SourceProviderTests;
 import org.apache.axis2.jaxws.provider.StringMessageProviderTests;
@@ -152,6 +153,7 @@
         suite.addTestSuite(SourceMessageProviderTests.class);
         // TODO FIXME: Test fails
         //suite.addTestSuite(SoapMessageProviderTests.class);
+        suite.addTestSuite(SoapMessageMUProviderTests.class);
         suite.addTestSuite(JAXBProviderTests.class);
         suite.addTestSuite(ProxyTests.class);
         //TODO: FIXME - Was working, now doesn't

Modified: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java?view=diff&rev=557104&r1=557103&r2=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java (original)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/AttachmentUtil.java Tue Jul 17 17:49:46 2007
@@ -21,11 +21,23 @@
 import java.awt.*;
 import java.awt.image.BufferedImage;
 import java.io.OutputStream;
+import java.io.StringReader;
+import java.io.StringWriter;
 import java.util.Iterator;
 
 import javax.imageio.IIOImage;
 import javax.imageio.ImageWriter;
 import javax.imageio.stream.ImageOutputStream;
+import javax.xml.soap.MessageFactory;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.transform.Result;
+import javax.xml.transform.Source;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
 
 /**
  * This will serve as a helper class for attachments utility methods. All methods
@@ -33,7 +45,81 @@
  *
  */
 public class AttachmentUtil {
- 
+    public static final String SOAP11_NAMESPACE = "http://schemas.xmlsoap.org/soap/envelope";
+    public static final String SOAP12_NAMESPACE = "http://www.w3.org/2003/05/soap-envelope";
+
+    public static final String MU_TEXT = "soap message mustUnderstand header request";
+    public static final String UNDERSTOOD_MU_TEXT = "understood headers soap message mustUnderstand header request";
+    public static final String TEXT = "soap message request";
+    public static final String VALUE = "value";
+    public static final String VALUE_NODE = "<"+VALUE+">";
+    public static final String VALUE_NODE_SLASH = "</"+VALUE+">";
+    public static final String XML_HEADER = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
+    public static final String MUHEADER_CLIENT = "ns1:muclient";
+    public static final String MUHEADER_SERVER = "ns1:muserver";
+    public static final String MUHEADER_CLIENT_UNDERSTOOD = "ns1:muclientunderstood";
+    public static final String MUHEADER_SERVER_UNDERSTOOD = "ns1:muserverunderstood";
+    public static final String msgEnvMU = 
+        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+            "<soapenv:Header>" +
+                "<"+MUHEADER_CLIENT+" xmlns:ns1=\"http://ws.apache.org/axis2\" soapenv:mustUnderstand=\"1\">MUinfo</"+MUHEADER_CLIENT+">" +
+            "</soapenv:Header>" +
+            "<soapenv:Body>" +
+                "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
+                    VALUE_NODE +
+                    MU_TEXT +
+                    VALUE_NODE_SLASH +
+                "</ns1:invoke>" +
+            "</soapenv:Body>" +
+        "</soapenv:Envelope>";
+    
+    public static final String msgEnv = 
+        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+            "<soapenv:Body>" +
+                "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
+                    VALUE_NODE +
+                    MU_TEXT +
+                    VALUE_NODE_SLASH +
+                "</ns1:invoke>" +
+            "</soapenv:Body>" +
+        "</soapenv:Envelope>";
+    
+    public static final String msgEnvPlain = 
+        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+            "<soapenv:Body>" +
+                "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
+                    VALUE_NODE +
+                    TEXT +
+                    VALUE_NODE_SLASH +
+                "</ns1:invoke>" +
+            "</soapenv:Body>" +
+        "</soapenv:Envelope>";
+
+    public static final String msgEnvMU_understood = 
+        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+            "<soapenv:Header>" +
+                "<"+MUHEADER_CLIENT_UNDERSTOOD+" xmlns:ns1=\"http://ws.apache.org/axis2\" soapenv:mustUnderstand=\"1\">MUinfo</"+MUHEADER_CLIENT_UNDERSTOOD+">" +
+            "</soapenv:Header>" +
+            "<soapenv:Body>" +
+                "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
+                    VALUE_NODE +
+                    UNDERSTOOD_MU_TEXT +
+                    VALUE_NODE_SLASH +
+                "</ns1:invoke>" +
+            "</soapenv:Body>" +
+        "</soapenv:Envelope>";
+    
+    public static final String msgEnv_understood = 
+        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
+            "<soapenv:Body>" +
+                "<ns1:invoke xmlns:ns1=\"http://ws.apache.org/axis2\">" +
+                    VALUE_NODE +
+                    UNDERSTOOD_MU_TEXT +
+                    VALUE_NODE_SLASH +
+                "</ns1:invoke>" +
+            "</soapenv:Body>" +
+        "</soapenv:Envelope>";
+    
     /**
      * Store a given image to an Image output stream
      * @param mimeType
@@ -56,5 +142,81 @@
         ios.flush();
         imageWriter.dispose();
     }
+    
+	/**
+	 * Adapter method used to convert any type of Source to a String
+	 * 
+	 * @param input
+	 * @return
+	 */
+	public static String toString(Source input) {
+
+		if (input == null)
+			return null;
+
+		StringWriter writer = new StringWriter();
+		Transformer trasformer;
+		try {
+			trasformer = TransformerFactory.newInstance().newTransformer();
+			Result result = new StreamResult(writer);
+			trasformer.transform(input, result);
+		} catch (Exception e) {
+			return null;
+		}
+
+		return writer.getBuffer().toString();
+	}
+
+	/**
+	 * Adapter method used to convert any type of SOAPMessage to a String
+	 * 
+	 * @param input
+	 * @return
+	 */
+	public static String toString(SOAPMessage input) {
+
+		if (input == null)
+			return null;
+
+		Source result = null;
+		try {
+			result = input.getSOAPPart().getContent();
+		} catch (SOAPException e) {
+			e.printStackTrace();
+		}
+
+		return toString(result);
+	}
+	
+	/**
+	 * Method used to convert Strings to SOAPMessages
+	 * 
+	 * @param msgString
+	 * @return
+	 */
+        public static SOAPMessage toSOAPMessage(String msgString) {
+
+         if (msgString == null) return null;
+
+         SOAPMessage message = null;
+         try {
+                 MessageFactory factory = null;
+
+                 // Force the usage of specific MesasgeFactories
+                 if (msgString.indexOf(SOAP11_NAMESPACE) >= 0) {
+                         factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
+                 } else {
+                         factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
+                 }
+                 message = factory.createMessage();
+                 message.getSOAPPart().setContent((Source) new StreamSource(new StringReader(msgString)));
+                 message.saveChanges();
+         } catch (SOAPException e) {
+                 System.out.println("toSOAPMessage Exception encountered: " + e);
+                 e.printStackTrace();
+         }
+         return message;     
+    }
+    
 }
 

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderChecker.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderChecker.java?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderChecker.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderChecker.java Tue Jul 17 17:49:46 2007
@@ -0,0 +1,67 @@
+/*
+ * 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.axis2.jaxws.provider;
+
+import org.apache.axiom.soap.SOAPEnvelope;
+import org.apache.axiom.soap.SOAPHeaderBlock;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+
+import javax.xml.namespace.QName;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+/**
+ * Plugin to remove "understood" headers for the SoapMessageMUProviderTests.  This class must
+ * be configured in the axis2.xml file on both the client and the server. 
+ */
+public class SoapMessageMUProviderChecker extends org.apache.axis2.handlers.AbstractHandler {
+
+    public InvocationResponse invoke(MessageContext msgContext) throws AxisFault {
+        // Get the list of headers for the roles we're acting in, then mark any we understand
+        // as processed.
+        SOAPEnvelope envelope = msgContext.getEnvelope();
+        if (envelope.getHeader() == null) {
+            return InvocationResponse.CONTINUE;
+        }
+        // These are the headers the test expects to be understood
+        String ns1 = "http://ws.apache.org/axis2";
+        String clientLocalName = "muclientunderstood";
+        String serverLocalName = "muserverunderstood";
+
+        QName clientQN = new QName(ns1, clientLocalName);
+        QName serverQN = new QName(ns1, serverLocalName);
+
+        Iterator headerBlocks = envelope.getHeader().getHeadersToProcess(null);
+        while (headerBlocks.hasNext()) {
+            SOAPHeaderBlock headerBlock = (SOAPHeaderBlock) headerBlocks.next();
+            QName headerQN = headerBlock.getQName();
+            if (clientQN.equals(headerQN)) {
+//                System.out.println("Marking as processed CLIENT QN: " + clientQN);
+                headerBlock.setProcessed();
+            } else if (serverQN.equals(headerQN)) {
+//                System.out.println("Marking as processed SERVER QN: " + serverQN);
+                headerBlock.setProcessed();
+            }
+        }
+
+        return InvocationResponse.CONTINUE;
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/SoapMessageMUProviderTests.java Tue Jul 17 17:49:46 2007
@@ -0,0 +1,201 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2007 International Business Machines Corp.
+ *
+ * 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.jaxws.provider;
+
+
+import javax.xml.ws.Service;
+import javax.xml.namespace.QName;
+import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.ws.BindingProvider;
+import javax.xml.soap.SOAPMessage;
+import junit.framework.TestCase;
+
+/**
+ * Tests Dispatch<SOAPMessage> client and a Provider<SOAPMessage> service
+ * with mustUnderstand attribute header.
+ */
+public class SoapMessageMUProviderTests extends TestCase {
+    public static final QName serviceName =
+            new QName("http://ws.apache.org/axis2", "SoapMessageMUProviderService");
+    public static final QName portName =
+            new QName("http://ws.apache.org/axis2", "SimpleProviderServiceSOAP11port0");
+    public static final String endpointUrl =
+            "http://localhost:8080/axis2/services/SoapMessageMUProviderService";
+
+    public static final String bindingID = SOAPBinding.SOAP11HTTP_BINDING;
+    public static final Service.Mode mode = Service.Mode.MESSAGE;
+
+    protected void setUp() throws Exception {
+        super.setUp();
+    }
+
+    protected void tearDown() throws Exception {
+        super.tearDown();
+    }
+
+    public SoapMessageMUProviderTests(String name) {
+        super(name);
+    }
+
+    /**
+     * Test soap message with no MU headers
+     */
+    public void testNoMustUnderstandHeaders() {
+        System.out.println("testNoMustUnderstandHeaders");
+        // create a service
+        Service svc = Service.create(serviceName);
+        svc.addPort(portName, bindingID, endpointUrl);
+
+        javax.xml.ws.Dispatch<SOAPMessage> dispatch = null;
+        dispatch = svc.createDispatch(portName, SOAPMessage.class, mode);
+
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_URI_PROPERTY, "echoString");
+
+        SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnvPlain);
+
+        try {
+            SOAPMessage response = dispatch.invoke(message);
+
+            String string = AttachmentUtil.toString(response);
+            assertTrue(string.equalsIgnoreCase(AttachmentUtil.XML_HEADER
+                    + AttachmentUtil.msgEnvPlain));
+        } catch (Exception e) {
+            fail("Unexpected Exception: " + e.getMessage());
+        }
+    }
+
+    /**
+     * Test the mustUnderstand soap header attribute on the client's
+     * outbound soap message for headers that are not understood.  Should cause an 
+     * exception.
+     */
+    public void testClientRequestNotUnderstoodHeaders() {
+        System.out.println("testClientRequestNotUnderstoodHeaders");
+        // create a service
+        Service svc = Service.create(serviceName);
+        svc.addPort(portName, bindingID, endpointUrl);
+
+        javax.xml.ws.Dispatch<SOAPMessage> dispatch = null;
+        dispatch = svc.createDispatch(portName, SOAPMessage.class, mode);
+
+        //force SOAPAction to match with wsdl action                        
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_URI_PROPERTY, "echoString");
+
+        SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnvMU);
+
+        try {
+            dispatch.invoke(message);
+            fail("Should have received fault for not understood headers on request");
+        } catch (Exception e) {
+            // Expected path
+        }
+    }
+
+    /**
+     * Test the mustUnderstand soap header attribute on the server's
+     * outbound soap message (i.e. the inbound response to the client) for headers that
+     * are not understood.  Should cause an exception.
+     */
+    public void testClientResponseNotUnderstoodHeaders() {
+        System.out.println("testClientResponseNotUnderstoodHeaders");
+        // create a service
+        Service svc = Service.create(serviceName);
+        svc.addPort(portName, bindingID, endpointUrl);
+
+        javax.xml.ws.Dispatch<SOAPMessage> dispatch = null;
+        dispatch = svc.createDispatch(portName, SOAPMessage.class, mode);
+
+        //force SOAPAction to match with wsdl action                        
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_URI_PROPERTY, "echoString");
+
+        SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnv);
+
+        try {
+            dispatch.invoke(message);
+            fail("Should have received fault for not understood headers on response");
+        } catch (Exception e) {
+            // Expected path
+        }
+    }
+
+    /**
+     * Test the mustUnderstand soap header attribute on the client's
+     * outbound soap message for headers that should be understood.  Should not cause an 
+     * exception.
+     */
+    public void testClientRequestUnderstoodHeaders() {
+        System.out.println("testClientRequestUnderstoodHeaders");
+        // create a service
+        Service svc = Service.create(serviceName);
+        svc.addPort(portName, bindingID, endpointUrl);
+
+        javax.xml.ws.Dispatch<SOAPMessage> dispatch = null;
+        dispatch = svc.createDispatch(portName, SOAPMessage.class, mode);
+
+        //force SOAPAction to match with wsdl action                        
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_URI_PROPERTY, "echoString");
+
+        SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnvMU_understood);
+
+        try {
+            dispatch.invoke(message);
+        } catch (Exception e) {
+            fail("Should not have received fault for headers that were understood.  " + e.getMessage());
+        }
+    }
+
+    /**
+     * Test the mustUnderstand soap header attribute on the server's
+     * outbound soap message (i.e. the inbound response to the client) for headers that
+     * are understood.  Should not cause an exception.
+     */
+    public void testClientResponseUnderstoodHeaders() {
+        System.out.println("testClientResponseUnderstoodHeaders");
+        // create a service
+        Service svc = Service.create(serviceName);
+        svc.addPort(portName, bindingID, endpointUrl);
+
+        javax.xml.ws.Dispatch<SOAPMessage> dispatch = null;
+        dispatch = svc.createDispatch(portName, SOAPMessage.class, mode);
+
+        //force SOAPAction to match with wsdl action                        
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_USE_PROPERTY, true);
+        ((BindingProvider) dispatch).getRequestContext()
+                                    .put(BindingProvider.SOAPACTION_URI_PROPERTY, "echoString");
+
+        SOAPMessage message = AttachmentUtil.toSOAPMessage(AttachmentUtil.msgEnv_understood);
+
+        try {
+            dispatch.invoke(message);
+        } catch (Exception e) {
+            fail("Should not have received fault for headers that were understood.  " + e.getMessage());
+        }
+    }
+}

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/MANIFEST.MF?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/MANIFEST.MF (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/MANIFEST.MF Tue Jul 17 17:49:46 2007
@@ -0,0 +1 @@
+Manifest-Version: 1.0

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/ProviderSOAPMessage.wsdl
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/ProviderSOAPMessage.wsdl?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/ProviderSOAPMessage.wsdl (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/ProviderSOAPMessage.wsdl Tue Jul 17 17:49:46 2007
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+-->
+
+<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
+    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
+    xmlns:s="http://www.w3.org/2001/XMLSchema" 
+    xmlns:tns="http://ws.apache.org/axis2"
+    xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
+    xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" 
+    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" 
+    targetNamespace="http://ws.apache.org/axis2" 
+    xmlns="http://schemas.xmlsoap.org/wsdl/">
+  <types>
+     	<xsd:schema
+			targetNamespace="http://ws.apache.org/axis2"
+			xmlns:tns="http://ws.apache.org/axis2"
+			xmlns:xsd="http://www.w3.org/2001/XMLSchema">
+			<xsd:complexType name="StringArray">
+				<xsd:sequence>
+					<xsd:element name="value" type="xsd:string"
+						minOccurs="0" maxOccurs="unbounded" />
+
+				</xsd:sequence>
+			</xsd:complexType>
+
+			<xsd:element name="inMessage" type="tns:StringArray" />
+			<xsd:element name="outMessage" type="tns:StringArray" />
+		        <xsd:element name="twoWayExceptionFault" type="xsd:string" />
+	</xsd:schema>
+    
+
+  </types>
+   
+  <message name="emptyMessage"/>
+  <message name="inMessage">
+    <part name="parameters" element="tns:inMessage" />
+  </message>
+  <message name="outMessage">
+    <part name="parameters" element="tns:outMessage" />
+  </message>
+
+  <portType name="EchoServiceInterface">
+    <operation name="invoke">
+      <input message="tns:inMessage" />
+      <output message="tns:outMessage" />
+    </operation>  
+  </portType>
+
+  <binding name="EchoServiceSoap" type="tns:EchoServiceInterface">
+    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
+    <operation name="invoke">
+      <soap:operation soapAction="echoString" style="document" />
+      <input>
+        <soap:body use="literal" />
+      </input>
+      <output>
+        <soap:body use="literal" />
+      </output>
+    </operation>
+  </binding>
+
+  <service name="SoapMessageMUProviderService">
+    <port name="SimpleProviderServiceSOAP11port0" binding="tns:EchoServiceSoap">
+      <soap:address location="http://localhost:8080/axis2/services/SoapMessageMUProviderService" />
+    </port>
+  </service>
+
+</definitions>

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/services.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/services.xml?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/services.xml (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/META-INF/services.xml Tue Jul 17 17:49:46 2007
@@ -0,0 +1,15 @@
+<serviceGroup>
+ <service name="SoapMessageMUProviderService">
+  <messageReceivers>
+   <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.jaxws.server.JAXWSMessageReceiver"/>
+  </messageReceivers>
+  <parameter locked="false" name="ServiceClass">org.apache.axis2.jaxws.provider.soapmsgmu.SoapMessageMUProvider</parameter>
+  <excludeOperations>
+     <operation>invoke</operation>
+  </excludeOperations>
+  <operation name="invoke" mep="http://www.w3.org/2004/08/wsdl/in-out">
+    <actionMapping/>
+  </operation>
+ </service>
+</serviceGroup>
+

Added: webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/SoapMessageMUProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/SoapMessageMUProvider.java?view=auto&rev=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/SoapMessageMUProvider.java (added)
+++ webservices/axis2/trunk/java/modules/jaxws/test/org/apache/axis2/jaxws/provider/soapmsgmu/SoapMessageMUProvider.java Tue Jul 17 17:49:46 2007
@@ -0,0 +1,84 @@
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ * Copyright 2007 International Business Machines Corp.
+ *
+ * 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.jaxws.provider.soapmsgmu;
+
+import javax.xml.ws.Provider;
+import javax.xml.ws.ServiceMode;
+import javax.xml.ws.Service;
+import javax.xml.ws.WebServiceProvider;
+import javax.xml.ws.BindingType;
+import javax.xml.ws.soap.SOAPBinding;
+import javax.xml.soap.SOAPMessage;
+
+import org.apache.axis2.jaxws.provider.AttachmentUtil;
+
+/**
+ * This class provides the server side implementation for JAX-WS Provider<MESSAGE>
+ * for SOAP11 Binding with Mode = MESSAGE.
+ *
+ * The receiving message and the sending back message
+ * must have the headers defined in wsdl.
+ */
+
+@WebServiceProvider()
+@ServiceMode(value = Service.Mode.MESSAGE)
+@BindingType(SOAPBinding.SOAP11HTTP_BINDING)
+public class SoapMessageMUProvider implements Provider<SOAPMessage> {
+    /**
+     * This service receives soap message and return it back to client as is
+     * or add a soap mustUnderstand attribute header and then return it back to client
+     *
+     * @param SOAPMessage object sent by the client
+     * @return the SOAPMessage
+     */
+    public SOAPMessage invoke(SOAPMessage request) {
+        System.out.println("----------------------------------------------");
+        System.out.println("SoapMessageMUProvider:Invoke: Request received");
+        SOAPMessage response = null;
+
+        try {
+            String string = AttachmentUtil.toString(request);
+            if (string != null) {
+                System.out.println("invoke: ---Received message= " + string);
+                if (string.contains(new StringBuffer(AttachmentUtil.UNDERSTOOD_MU_TEXT))) {
+                    String responseStr =
+                            AttachmentUtil.msgEnvMU_understood.replaceAll(AttachmentUtil.MUHEADER_CLIENT_UNDERSTOOD,
+                                                                          AttachmentUtil.MUHEADER_SERVER_UNDERSTOOD);
+                    response = AttachmentUtil.toSOAPMessage(responseStr);
+                    System.out.println("invoke: ---Response message= "
+                            + AttachmentUtil.toString(response));
+                } else if (string.contains(new StringBuffer(AttachmentUtil.MU_TEXT))) {
+                    String responseStr =
+                            AttachmentUtil.msgEnvMU.replaceAll(AttachmentUtil.MUHEADER_CLIENT,
+                                                               AttachmentUtil.MUHEADER_SERVER);
+                    response = AttachmentUtil.toSOAPMessage(responseStr);
+                    System.out.println("invoke: ---Response message= "
+                            + AttachmentUtil.toString(response));
+                } else {
+                    response = request;
+                }
+            } else {
+                String badResult = "***ERROR at Service Endpoint: Received message is NULL.";
+                throw new NullPointerException(badResult);
+            }
+        } catch (Exception e) {
+            System.out.println("SoapMessageMUProviderService: Failed with exception.");
+            e.printStackTrace();
+        }
+        return response;
+    }
+}

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java?view=diff&rev=557104&r1=557103&r2=557104
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/AxisEngine.java Tue Jul 17 17:49:46 2007
@@ -132,9 +132,9 @@
             InvocationResponse pi = invoke(msgContext, NOT_RESUMING_EXECUTION);
 
             if (pi.equals(InvocationResponse.CONTINUE)) {
+                checkMustUnderstand(msgContext);
                 if (msgContext.isServerSide()) {
                     // invoke the Message Receivers
-                    checkMustUnderstand(msgContext);
 
                     MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
                     if (receiver == null) {
@@ -277,9 +277,9 @@
         //invoking the MR
 
         if (pi.equals(InvocationResponse.CONTINUE)) {
+            checkMustUnderstand(msgContext);
             if (msgContext.isServerSide()) {
                 // invoke the Message Receivers
-                checkMustUnderstand(msgContext);
                 MessageReceiver receiver = msgContext.getAxisOperation().getMessageReceiver();
                 if (receiver == null) {
                     throw new AxisFault(Messages.getMessage(



---------------------------------------------------------------------
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