axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinth...@apache.org
Subject svn commit: r225253 - in /webservices/axis/trunk/java/modules: addressing/test/org/apache/axis2/handlers/util/ core/src/org/apache/axis2/clientapi/ core/src/org/apache/axis2/transport/ core/src/org/apache/axis2/transport/http/ core/src/org/apache/axis2...
Date Tue, 26 Jul 2005 07:54:49 GMT
Author: chinthaka
Date: Tue Jul 26 00:51:27 2005
New Revision: 225253

URL: http://svn.apache.org/viewcvs?rev=225253&view=rev
Log:
- added another parameter to StAXSOAPModelBuilder constructor to get the SOAP version from the transport
- changed MTOM stuff to only to use SOAP 1.2

Modified:
    webservices/axis/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
    webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java
    webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java
    webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
    webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEHelper.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/factory/OMXMLBuilderFactory.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPConstants.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java
    webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java
    webservices/axis/trunk/java/modules/xml/test-resources/mtom/MTOMBuilderTestIn.txt
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/attachments/ImageSampleTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/IteratorTester.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMChildrenQNameIteratorTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMNavigatorTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestCase.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilderTest.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPTestCase.java
    webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java

Modified: webservices/axis/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java (original)
+++ webservices/axis/trunk/java/modules/addressing/test/org/apache/axis2/handlers/util/TestUtil.java Tue Jul 26 00:51:27 2005
@@ -41,7 +41,7 @@
         XMLStreamReader parser = XMLInputFactory.newInstance()
                 .createXMLStreamReader(
                         new FileReader(getTestResourceFile(fileName)));
-        builder = new StAXSOAPModelBuilder(parser);
+        builder = new StAXSOAPModelBuilder(parser, null);
         return builder;
     }
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/clientapi/TwoWayTransportBasedSender.java Tue Jul 26 00:51:27 2005
@@ -48,7 +48,7 @@
         //If request is REST we assume the response is REST, so set the variable
         response.setDoingREST(msgctx.isDoingREST());
 
-        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(response);
+        SOAPEnvelope resenvelope = TransportUtils.createSOAPMessage(response, msgctx.getEnvelope().getNamespace().getName());
         if (resenvelope != null) {
             response.setEnvelope(resenvelope);
             engine = new AxisEngine(msgctx.getSystemContext());

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java Tue Jul 26 00:51:27 2005
@@ -35,7 +35,7 @@
 import java.io.Reader;
 
 public class TransportUtils {
-    public static SOAPEnvelope createSOAPMessage(MessageContext msgContext) throws AxisFault {
+    public static SOAPEnvelope createSOAPMessage(MessageContext msgContext, String soapNamespaceURI) throws AxisFault {
 
         InputStream inStream = (InputStream) msgContext.getProperty(
                 MessageContext.TRANSPORT_IN);
@@ -45,11 +45,11 @@
         if (inStream == null) {
             throw new AxisFault(Messages.getMessage("inputstreamNull"));
         }
-        return createSOAPMessage(msgContext, inStream);
+        return createSOAPMessage(msgContext, inStream, soapNamespaceURI);
     }
 
-    public static SOAPEnvelope createSOAPMessage(MessageContext msgContext,
-                                                 InputStream inStream)
+    private static SOAPEnvelope createSOAPMessage(MessageContext msgContext,
+                                                 InputStream inStream, String soapNamespaceURI)
             throws AxisFault {
         try {
             Object contentType = null;
@@ -87,7 +87,7 @@
                 XMLStreamReader xmlreader =
                         XMLInputFactory.newInstance().createXMLStreamReader(
                                 reader);
-                builder = new StAXSOAPModelBuilder(xmlreader);
+                builder = new StAXSOAPModelBuilder(xmlreader, soapNamespaceURI);
                 envelope = (SOAPEnvelope) builder.getDocumentElement();
             }
             return envelope;

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/http/HTTPTransportUtils.java Tue Jul 26 00:51:27 2005
@@ -63,18 +63,21 @@
         InputStream in,
         OutputStream out,
         String contentType,
-        String soapAction,
+        String soapActionHeader,
         String requestURI,
         ConfigurationContext configurationContext)
         throws AxisFault {
         try {
+
+
             //remove the starting and trailing " from the SOAP Action
-            if (soapAction != null && soapAction.startsWith("\"") && soapAction.endsWith("\"")) {
-                soapAction = soapAction.substring(1, soapAction.length() - 1);
+            if (soapActionHeader != null && soapActionHeader.startsWith("\"") && soapActionHeader.endsWith("\"")) {
+
+                soapActionHeader = soapActionHeader.substring(1, soapActionHeader.length() - 1);
             }
             //fill up the Message Contexts
-            msgContext.setWSAAction(soapAction);
-            msgContext.setSoapAction(soapAction);
+            msgContext.setWSAAction(soapActionHeader);
+            msgContext.setSoapAction(soapActionHeader);
             msgContext.setTo(new EndpointReference(AddressingConstants.WSA_TO, requestURI));
             msgContext.setProperty(MessageContext.TRANSPORT_OUT, out);
             msgContext.setServerSide(true);
@@ -92,12 +95,12 @@
                         XMLInputFactory.newInstance().createXMLStreamReader(reader);
                     if (contentType.indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
                         //it is SOAP 1.2
-                        builder = new StAXSOAPModelBuilder(xmlreader);
+                        builder = new StAXSOAPModelBuilder(xmlreader, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
                         envelope = (SOAPEnvelope) builder.getDocumentElement();
                     } else if (contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
                         //it is SOAP 1.1
                         Object enable = msgContext.getProperty(Constants.Configuration.ENABLE_REST);
-                        if ((soapAction == null || soapAction.length() == 0)
+                        if ((soapActionHeader == null || soapActionHeader.length() == 0)
                             && Constants.VALUE_TRUE.equals(enable)) {
                             //If the content Type is text/xml (BTW which is the SOAP 1.1 Content type ) and
                             //the SOAP Action is absent it is rest !!
@@ -108,7 +111,7 @@
                             envelope = soapFactory.getDefaultEnvelope();
                             envelope.getBody().addChild(builder.getDocumentElement());
                         }else{
-                            builder = new StAXSOAPModelBuilder(xmlreader);
+                            builder = new StAXSOAPModelBuilder(xmlreader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
                             envelope = (SOAPEnvelope) builder.getDocumentElement();
                         }
                     }
@@ -220,6 +223,7 @@
         XMLStreamReader reader =
             XMLInputFactory.newInstance().createXMLStreamReader(
                 new BufferedReader(new InputStreamReader(mimeHelper.getSOAPPartInputStream())));
+
         /*
          * put a reference to Attachments in to the message context
          */
@@ -228,10 +232,10 @@
             /*
              * Creates the MTOM specific MTOMStAXSOAPModelBuilder
              */
-            builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper);
+            builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         } else if (mimeHelper.getAttachmentSpecType().equals(MIMEHelper.SWA_TYPE)) {
-            builder = new StAXSOAPModelBuilder(reader);
-        }
+            builder = new StAXSOAPModelBuilder(reader, SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+        } 
         return builder;
     }
 

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/local/LocalTransportReceiver.java Tue Jul 26 00:51:27 2005
@@ -67,7 +67,7 @@
                 XMLInputFactory.newInstance().createXMLStreamReader(
                     new BufferedReader(new InputStreamReader(in)));
 
-            StAXBuilder builder = new StAXSOAPModelBuilder(reader);
+            StAXBuilder builder = new StAXSOAPModelBuilder(reader, null);
             SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
             msgCtx.setEnvelope(envelope);
             AxisEngine engine = new AxisEngine(confContext);

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/MailWorker.java Tue Jul 26 00:51:27 2005
@@ -29,6 +29,8 @@
 import org.apache.axis2.om.impl.llom.builder.StAXBuilder;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis2.util.threadpool.AxisWorker;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -118,7 +120,16 @@
                 String message = mimeMessage.getContent().toString();
                 ByteArrayInputStream bais = new ByteArrayInputStream(message.getBytes());
                 XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(bais);
-                StAXBuilder builder = new StAXSOAPModelBuilder(reader);
+
+                String soapNamespaceURI = "";
+                if(mimeMessage.getContentType().indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1){
+                   soapNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+                }else if(mimeMessage.getContentType().indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1){
+                    soapNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+
+                }
+                StAXBuilder builder = new StAXSOAPModelBuilder(reader, soapNamespaceURI);
+
                 SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
                 msgContext.setEnvelope(envelope);
                 if (envelope.getBody().hasFault()) {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/mail/server/MailSorter.java Tue Jul 26 00:51:27 2005
@@ -10,6 +10,8 @@
 import org.apache.axis2.om.impl.llom.builder.StAXBuilder;
 import org.apache.axis2.soap.SOAPEnvelope;
 import org.apache.axis2.soap.impl.llom.builder.StAXSOAPModelBuilder;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
+import org.apache.axis2.soap.impl.llom.soap11.SOAP11Constants;
 import org.apache.axis2.transport.mail.MailConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -38,6 +40,7 @@
     private ConfigurationContext configurationContext = null;
     protected static Log log = LogFactory.getLog(MailSorter.class.getName());
     private boolean actAsMailet = false;
+
     public MailSorter(Storage st, ConfigurationContext configurationContext) {
         this.st = st;
         sUsers.add("axis2-server@localhost");
@@ -70,12 +73,9 @@
         // create and initialize a message context
         try {
             msgContext =
-                new MessageContext(
-                    confContext,
-                    confContext.getAxisConfiguration().getTransportIn(
-                        new QName(Constants.TRANSPORT_MAIL)),
-                    confContext.getAxisConfiguration().getTransportOut(
-                        new QName(Constants.TRANSPORT_MAIL)));
+                    new MessageContext(confContext,
+                            confContext.getAxisConfiguration().getTransportIn(new QName(Constants.TRANSPORT_MAIL)),
+                            confContext.getAxisConfiguration().getTransportOut(new QName(Constants.TRANSPORT_MAIL)));
             msgContext.setServerSide(true);
 
             msgContext.setProperty(MailConstants.CONTENT_TYPE, mimeMessage.getContentType());
@@ -88,16 +88,13 @@
 
             String replyTo = ((InternetAddress) mimeMessage.getReplyTo()[0]).getAddress();
             if (replyTo != null) {
-                msgContext.setReplyTo(
-                    new EndpointReference(AddressingConstants.WSA_REPLY_TO, replyTo));
+                msgContext.setReplyTo(new EndpointReference(AddressingConstants.WSA_REPLY_TO, replyTo));
             }
 
             String recepainets = ((InternetAddress) mimeMessage.getAllRecipients()[0]).getAddress();
 
             if (recepainets != null) {
-                msgContext.setTo(
-                    new EndpointReference(
-                        AddressingConstants.WSA_FROM,
+                msgContext.setTo(new EndpointReference(AddressingConstants.WSA_FROM,
                         recepainets + "/" + serviceURL));
             }
 
@@ -106,8 +103,16 @@
             System.out.println("message[" + message + "]");
             ByteArrayInputStream bais = new ByteArrayInputStream(message.getBytes());
             XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(bais);
-            StAXBuilder builder = new StAXSOAPModelBuilder(reader);
-  
+
+            String soapNamespaceURI = "";
+            if (mimeMessage.getContentType().indexOf(SOAP12Constants.SOAP_12_CONTENT_TYPE) > -1) {
+                soapNamespaceURI = SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+            } else if (mimeMessage.getContentType().indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE) > -1) {
+                soapNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
+
+            }
+            StAXBuilder builder = new StAXSOAPModelBuilder(reader, soapNamespaceURI);
+
             SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
             msgContext.setEnvelope(envelope);
             if (envelope.getBody().hasFault()) {

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis2/transport/tcp/TCPWorker.java Tue Jul 26 00:51:27 2005
@@ -75,7 +75,7 @@
                 //create the SOAP Envelope
                 Reader in = new InputStreamReader(socket.getInputStream());
                 XMLStreamReader xmlreader = XMLInputFactory.newInstance().createXMLStreamReader(in);
-                StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
+                StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, null);
                 SOAPEnvelope envelope = (SOAPEnvelope) builder.getDocumentElement();
                 msgContext.setEnvelope(envelope);
                 if (envelope.getBody().hasFault()) {

Modified: webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java (original)
+++ webservices/axis/trunk/java/modules/core/test/org/apache/axis2/transport/tcp/TCPTransportTest.java Tue Jul 26 00:51:27 2005
@@ -71,7 +71,7 @@
         try {
             XMLStreamReader xmlreader =
                     XMLInputFactory.newInstance().createXMLStreamReader(in);
-            StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader);
+            StAXBuilder builder = new StAXSOAPModelBuilder(xmlreader, null);
             return (SOAPEnvelope) builder.getDocumentElement();
         } catch (Exception e) {
             throw new AxisFault(e.getMessage(), e);

Modified: webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java (original)
+++ webservices/axis/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPPartImpl.java Tue Jul 26 00:51:27 2005
@@ -81,7 +81,7 @@
                 stAXSOAPModelBuilder =
                         new StAXSOAPModelBuilder(
                                 XMLInputFactory.newInstance()
-                        .createXMLStreamReader(inr));
+                        .createXMLStreamReader(inr), null);
                 org.apache.axis2.soap.SOAPEnvelope omEnv = stAXSOAPModelBuilder.getSOAPEnvelope();
                 envelope = new SOAPEnvelopeImpl(omEnv);
                 ((SOAPEnvelopeImpl) envelope).setOwnerDocument(this);

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMCommonsChunkingTest.java Tue Jul 26 00:51:27 2005
@@ -45,6 +45,7 @@
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.impl.llom.OMTextImpl;
 import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -126,7 +127,6 @@
     }
 
     public void testEchoXMLSync() throws Exception {
-        SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
 
         OMElement payload = createEnvelope();
 
@@ -136,7 +136,8 @@
         call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
         call.setTransportInfo(Constants.TRANSPORT_COMMONS_HTTP,
                 Constants.TRANSPORT_HTTP, false);
-        OMElement result = (OMElement) call.invokeBlocking(operationName
+        call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
+        OMElement result = call.invokeBlocking(operationName
                 .getLocalPart(), payload);
 
         OMElement ele = (OMElement) result.getFirstChild();

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMLoadTest.java Tue Jul 26 00:51:27 2005
@@ -40,6 +40,7 @@
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.impl.llom.OMTextImpl;
 import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -132,8 +133,9 @@
                     Constants.VALUE_TRUE);
             call.setTransportInfo(Constants.TRANSPORT_HTTP,
                     Constants.TRANSPORT_HTTP, false);
+            call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 
-            OMElement result = (OMElement) call.invokeBlocking(operationName
+            OMElement result = call.invokeBlocking(operationName
                     .getLocalPart(),
                     payload);
             OMElement ele = (OMElement) result.getFirstChild();

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMTest.java Tue Jul 26 00:51:27 2005
@@ -39,6 +39,7 @@
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.impl.llom.OMTextImpl;
 import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -50,8 +51,7 @@
 import java.io.InputStream;
 
 public class EchoRawMTOMTest extends TestCase {
-    private EndpointReference targetEPR = new EndpointReference(
-            AddressingConstants.WSA_TO,
+    private EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO,
             "http://127.0.0.1:"
             + (UtilServer.TESTING_PORT)
             + "/axis/services/EchoXMLService/echoOMElement");
@@ -78,7 +78,7 @@
     private ServiceDescription service;
 
     private boolean finish = false;
-    
+
     private OMTextImpl expectedTextData;
 
     public EchoRawMTOMTest() {
@@ -113,8 +113,7 @@
         Image expectedImage;
         expectedImage =
                 new JDK13IO()
-                .loadImage(
-                        getResourceAsStream("org/apache/axis2/mtom/test.jpg"));
+                .loadImage(getResourceAsStream("org/apache/axis2/mtom/test.jpg"));
         ImageDataSource dataSource = new ImageDataSource("test.jpg",
                 expectedImage);
         expectedDH = new DataHandler(dataSource);
@@ -135,6 +134,7 @@
         call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
         call.setTransportInfo(Constants.TRANSPORT_HTTP,
                 Constants.TRANSPORT_HTTP, false);
+        call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 
         OMElement result = (OMElement) call.invokeBlocking(operationName
                 .getLocalPart(),
@@ -161,6 +161,7 @@
         ClassLoader cl = Thread.currentThread().getContextClassLoader();
         return cl.getResourceAsStream(path);
     }
+
     private void compareWithCreatedOMText(OMText actualTextData) {
         String originalTextValue = expectedTextData.getText();
         String returnedTextValue = actualTextData.getText();

Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis2/mtom/EchoRawMTOMToBase64Test.java Tue Jul 26 00:51:27 2005
@@ -42,15 +42,15 @@
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.impl.llom.OMTextImpl;
 import org.apache.axis2.soap.SOAPFactory;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 import org.apache.axis2.util.Utils;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 public class EchoRawMTOMToBase64Test extends TestCase {
-    private EndpointReference targetEPR = new EndpointReference(
-            AddressingConstants.WSA_TO, "http://127.0.0.1:"
-                    + (UtilServer.TESTING_PORT)
-                    + "/axis/services/EchoXMLService/echoMTOMtoBase64");
+    private EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:"
+            + (UtilServer.TESTING_PORT)
+            + "/axis/services/EchoXMLService/echoMTOMtoBase64");
 
     private Log log = LogFactory.getLog(getClass());
 
@@ -101,10 +101,9 @@
         OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
         OMElement rpcWrapEle = fac.createOMElement("echoMTOMtoBase64", omNs);
         OMElement data = fac.createOMElement("data", omNs);
-        byte[] byteArray = new byte[] { 13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
-                98 };
-        DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(
-                byteArray));
+        byte[] byteArray = new byte[]{13, 56, 65, 32, 12, 12, 7, -3, -2, -1,
+                                      98};
+        DataHandler dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
         expectedTextData = new OMTextImpl(dataHandler, true);
         data.addChild(expectedTextData);
         rpcWrapEle.addChild(data);
@@ -123,8 +122,9 @@
             call.set(Constants.Configuration.ENABLE_MTOM, Constants.VALUE_TRUE);
             call.setTransportInfo(Constants.TRANSPORT_HTTP,
                     Constants.TRANSPORT_HTTP, false);
+            call.setSoapVersionURI(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
 
-            OMElement result = (OMElement) call.invokeBlocking(operationName
+            OMElement result = call.invokeBlocking(operationName
                     .getLocalPart(), payload);
 
             OMElement data = (OMElement) result.getFirstChild();

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEHelper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEHelper.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEHelper.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/attachments/MIMEHelper.java Tue Jul 26 00:51:27 2005
@@ -157,7 +157,7 @@
                 this.applicationType = SWA_TYPE;
             } else {
                 throw new OMException(
-                "Invalid Application type. Support available for MTOM & SwA only.");
+                "Invalid Application type. Support available for MTOM/SOAP 1.2 & SwA/SOAP 1.l only.");
             }
         }
         return this.applicationType;

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/factory/OMXMLBuilderFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/factory/OMXMLBuilderFactory.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/factory/OMXMLBuilderFactory.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/factory/OMXMLBuilderFactory.java Tue Jul 26 00:51:27 2005
@@ -55,7 +55,7 @@
      */
     public static StAXSOAPModelBuilder createStAXSOAPModelBuilder(
             SOAPFactory soapFactory, XMLStreamReader parser) {
-        return new StAXSOAPModelBuilder(parser);
+        return new StAXSOAPModelBuilder(parser, soapFactory, null);
     }
 
     /**

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilder.java Tue Jul 26 00:51:27 2005
@@ -44,8 +44,8 @@
 
     public MTOMStAXSOAPModelBuilder(XMLStreamReader parser,
                                     SOAPFactory factory,
-                                    MIMEHelper mimeHelper) {
-        super(parser, factory);
+                                    MIMEHelper mimeHelper, String soapVersion) {
+        super(parser, factory, soapVersion);
         this.mimeHelper = mimeHelper;
     }
 
@@ -54,8 +54,8 @@
      * @param mimeHelper
      */
     public MTOMStAXSOAPModelBuilder(XMLStreamReader reader,
-                                    MIMEHelper mimeHelper) {
-        super(reader);
+                                    MIMEHelper mimeHelper, String soapVersion) {
+        super(reader, soapVersion);
         this.mimeHelper = mimeHelper;
     }
 

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPConstants.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPConstants.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/SOAPConstants.java Tue Jul 26 00:51:27 2005
@@ -72,4 +72,8 @@
             SOAP_DEFAULT_NAMESPACE_PREFIX;
 
     public static final String SOAP_FAULT_DETAIL_EXCEPTION_ENTRY = "Exception";
+
+    // -------- SOAP Exceptions ------------------------------
+
+    
 }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilder.java Tue Jul 26 00:51:27 2005
@@ -47,6 +47,7 @@
     private SOAPEnvelopeImpl envelope;
     private OMNamespace envelopeNamespace;
 
+
     private SOAPFactory soapFactory;
 
     /**
@@ -77,6 +78,7 @@
     */
     private boolean processingMandatoryFaultElements = false;
 
+
     //added
     /* This is used to indicate whether detail element is processing in soap 1.2 builderhelper
     */
@@ -86,52 +88,81 @@
 
     /**
      * Constructor StAXSOAPModelBuilder
+     * soapVersion parameter is to give the soap version from the transport. For example, in HTTP case
+     * you can identify the version of the soap message u have recd by looking at the HTTP headers. By passing that
+     * here is to check whether actually the soap message contained also of that version.
+     * If one is not creating the builder from the transport he can just pass null for this.
+     *
      *
      * @param parser
      */
-    public StAXSOAPModelBuilder(XMLStreamReader parser) {
+    public StAXSOAPModelBuilder(XMLStreamReader parser, String soapVersion) {
         super(parser);
         soapFactory = OMAbstractFactory.getDefaultSOAPFactory();
-        identifySOAPVersion();
+        identifySOAPVersion(soapVersion);
         parseHeaders();
     }
 
-    public StAXSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory) {
+    /**
+     *
+     * @param parser
+     * @param factory
+     * @param soapVersion parameter is to give the soap version from the transport. For example, in HTTP case
+     * you can identify the version of the soap message u have recd by looking at the HTTP headers. By passing that
+     * here is to check whether actually the soap message contained also of that version.
+     * If one is not creating the builder from the transport he can just pass null for this.
+     */
+    public StAXSOAPModelBuilder(XMLStreamReader parser, SOAPFactory factory, String soapVersion) {
         super(parser);
         soapFactory = factory;
-        identifySOAPVersion();
+        identifySOAPVersion(soapVersion);
 
         parseHeaders();
     }
 
-    private void identifySOAPVersion() {
+    private void identifySOAPVersion(String soapVersionURIFromTransport) {
+
         SOAPEnvelope soapEnvelope = getSOAPEnvelope();
         if (soapEnvelope == null) {
-            throw new OMException("No SOAPHeader present !!");
+            throw new OMException("env:VersionMismatch");
         }
 
-        envelopeNamespace =
-                soapEnvelope.findNamespace(
-                        SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
-        if (envelopeNamespace == null) {
-            envelopeNamespace =
-                    getSOAPEnvelope().findNamespace(
-                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
-            if (envelopeNamespace == null) {
-                throw new OMException(
-                        "Invalid SOAP message. Doesn't have proper namespace declaration !!");
-            } else {
-                log.info("SOAP 1.1 message received ..");
-                soapFactory = OMAbstractFactory.getSOAP11Factory();
-            }
-        } else {
-            log.info("SOAP 1.2 message received ..");
-            soapFactory = OMAbstractFactory.getSOAP12Factory();
+        envelopeNamespace = soapEnvelope.getNamespace();
+        String namespaceName = envelopeNamespace.getName();
+        if ((soapVersionURIFromTransport != null) && !(soapVersionURIFromTransport.equals(namespaceName))) {
+            throw new OMException("env:VersionMismatch");
         }
 
-        omfactory = soapFactory;
+        if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceName)) {
+            soapFactory = OMAbstractFactory.getSOAP12Factory();
+        } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(namespaceName)) {
+            soapFactory = OMAbstractFactory.getSOAP11Factory();
+        } else {
+            throw new OMException("env:VersionMismatch");
+        }
     }
 
+//        envelopeNamespace =
+//                soapEnvelope.getNamespace().getName()
+
+
+//        if (envelopeNamespace == null) {
+//            envelopeNamespace =
+//                    getSOAPEnvelope().findNamespace(
+//                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI, "");
+//            if (envelopeNamespace == null ) {
+//                throw new OMException(
+//                        "Invalid SOAP message. Doesn't have proper namespace declaration !!");
+//            } else {
+//                log.info("SOAP 1.1 message received ..");
+//                soapFactory = OMAbstractFactory.getSOAP11Factory();
+//            }
+//        } else {
+//            log.info("SOAP 1.2 message received ..");
+//            soapFactory = OMAbstractFactory.getSOAP12Factory();
+//        }
+
+
     private void parseHeaders() {
         // by the time execution comes here the nullity of SOAPEnvelope has been cheched in the
         // identifySOAPVersion() method. So not checking getSOAPEnvelope() == null here
@@ -185,8 +216,7 @@
         }
 
 
-        log.info(
-                "Build the OMElelment " + node.getLocalName() +
+        log.info("Build the OMElelment " + node.getLocalName() +
                 "By the StaxSOAPModelBuilder");
         return node;
     }
@@ -203,8 +233,7 @@
                                       boolean isEnvelope) {
         OMElement element = null;
         if (parent == null) {
-            if (!elementName.equalsIgnoreCase(
-                    SOAPConstants.SOAPENVELOPE_LOCAL_NAME)) {
+            if (!elementName.equalsIgnoreCase(SOAPConstants.SOAPENVELOPE_LOCAL_NAME)) {
                 throw new OMException("First Element must contain the local name, "
                         + SOAPConstants.SOAPENVELOPE_LOCAL_NAME);
             }
@@ -212,16 +241,15 @@
                     (SOAPEnvelopeImpl) soapFactory.createSOAPEnvelope(this);
             element = envelope;
             processNamespaceData(element, true);
-            // fill in the attributes
+// fill in the attributes
             processAttributes(element);
 
         } else if (elementLevel == 2) {
 
-            // this is either a header or a body
+// this is either a header or a body
             if (elementName.equals(SOAPConstants.HEADER_LOCAL_NAME)) {
                 if (headerPresent) {
-                    throw new OMBuilderException(
-                            "Multiple headers encountered!");
+                    throw new OMBuilderException("Multiple headers encountered!");
                 }
                 if (bodyPresent) {
                     throw new OMBuilderException("Header Body wrong order!");
@@ -231,36 +259,33 @@
                         soapFactory.createSOAPHeader((SOAPEnvelope) parent,
                                 this);
 
-                // envelope.setHeader((SOAPHeader)element);
+// envelope.setHeader((SOAPHeader)element);
                 processNamespaceData(element, true);
                 processAttributes(element);
 
             } else if (elementName.equals(SOAPConstants.BODY_LOCAL_NAME)) {
                 if (bodyPresent) {
-                    throw new OMBuilderException(
-                            "Multiple body elements encountered");
+                    throw new OMBuilderException("Multiple body elements encountered");
                 }
                 bodyPresent = true;
                 element =
                         soapFactory.createSOAPBody((SOAPEnvelope) parent,
                                 this);
 
-                // envelope.setBody((SOAPBody)element);
+// envelope.setBody((SOAPBody)element);
                 processNamespaceData(element, true);
                 processAttributes(element);
 
             } else {
-                throw new OMBuilderException(
-                        elementName
+                throw new OMBuilderException(elementName
                         +
                         " is not supported here. Envelope can not have elements other than Header and Body.");
             }
         } else if ((elementLevel == 3)
                 &&
-                parent.getLocalName().equalsIgnoreCase(
-                        SOAPConstants.HEADER_LOCAL_NAME)) {
+                parent.getLocalName().equalsIgnoreCase(SOAPConstants.HEADER_LOCAL_NAME)) {
 
-            // this is a headerblock
+// this is a headerblock
             try {
                 element =
                         soapFactory.createSOAPHeaderBlock(elementName, null,
@@ -272,12 +297,10 @@
             processAttributes(element);
 
         } else if ((elementLevel == 3) &&
-                parent.getLocalName().equalsIgnoreCase(
-                        SOAPConstants.BODY_LOCAL_NAME) &&
-                elementName.equalsIgnoreCase(
-                        SOAPConstants.BODY_FAULT_LOCAL_NAME)) {
+                parent.getLocalName().equalsIgnoreCase(SOAPConstants.BODY_LOCAL_NAME) &&
+                elementName.equalsIgnoreCase(SOAPConstants.BODY_FAULT_LOCAL_NAME)) {
 
-            // this is a headerblock
+// this is a headerblock
             element = soapFactory.createSOAPFault((SOAPBody) parent, this);
             processNamespaceData(element, false);
             processAttributes(element);
@@ -285,13 +308,11 @@
 
             processingFault = true;
 
-            //added
+//added
             processingMandatoryFaultElements = true;
-            if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(
-                    envelopeNamespace.getName())) {
+            if (SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(envelopeNamespace.getName())) {
                 builderHelper = new SOAP12BuilderHelper(this);
-            } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(
-                    envelopeNamespace.getName())) {
+            } else if (SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI.equals(envelopeNamespace.getName())) {
                 builderHelper = new SOAP11BuilderHelper(this);
             }
 
@@ -299,7 +320,7 @@
             element = builderHelper.handleEvent(parser, parent, elementLevel);
         } else {
 
-            // this is neither of above. Just create an element
+// this is neither of above. Just create an element
             element = soapFactory.createOMElement(elementName, null,
                     parent, this);
             processNamespaceData(element, false);
@@ -396,13 +417,13 @@
                     parser.getNamespacePrefix(i));
         }
 
-        // set the own namespace
+// set the own namespace
         String namespaceURI = parser.getNamespaceURI();
         String prefix = parser.getPrefix();
         OMNamespace namespace = null;
         if (!"".equals(namespaceURI)) {
             if (prefix == null) {
-                // this means, this elements has a default namespace or it has inherited a default namespace from its parent
+// this means, this elements has a default namespace or it has inherited a default namespace from its parent
                 namespace = node.findNamespace(namespaceURI, "");
                 if (namespace == null) {
                     namespace = node.declareNamespace(namespaceURI, "");
@@ -417,26 +438,24 @@
 
 
 
-        // TODO we got to have this to make sure OM reject mesagess that are not name space qualified
-        // But got to comment this to interop with Axis.1.x
-        // if (namespace == null) {
-        // throw new OMException("All elements must be namespace qualified!");
-        // }
+// TODO we got to have this to make sure OM reject mesagess that are not name space qualified
+// But got to comment this to interop with Axis.1.x
+// if (namespace == null) {
+// throw new OMException("All elements must be namespace qualified!");
+// }
         if (isSOAPElement) {
             if (node.getNamespace() != null &&
-                    !node.getNamespace().getName().equals(
-                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI) &&
-                    !node.getNamespace().getName().equals(
-                            SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
+                    !node.getNamespace().getName().equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI) &&
+                    !node.getNamespace().getName().equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
                 throw new OMBuilderException("invalid SOAP namespace URI");
             }
         }
 
     }
 
-    //added
-    /*these three methods to set and check detail element processing or mandatory fault element are present
-    */
+//added
+/*these three methods to set and check detail element processing or mandatory fault element are present
+*/
     public OMNamespace getEnvelopeNamespace() {
         return envelopeNamespace;
     }

Modified: webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java (original)
+++ webservices/axis/trunk/java/modules/xml/src/org/apache/axis2/soap/impl/llom/soap11/SOAP11FaultSubCodeImpl.java Tue Jul 26 00:51:27 2005
@@ -51,23 +51,20 @@
     protected void checkParent(OMElement parent) throws SOAPProcessingException {
         if (!(parent instanceof SOAP11FaultSubCodeImpl) ||
                 (parent instanceof SOAP11FaultCodeImpl)) {
-            throw new SOAPProcessingException(
-                    "Expecting SOAP 1.1 implementation of SOAP FaultSubCode or SOAP FaultCode as the parent. But received some other implementation");
+            throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP FaultSubCode or SOAP FaultCode as the parent. But received some other implementation");
         }
     }
 
     public void setSubCode(SOAPFaultSubCode subCode) throws SOAPProcessingException {
-        if (!(subCode instanceof SOAP11FaultSubCodeImpl)) {
-            throw new SOAPProcessingException(
-                    "Expecting SOAP 1.1 implementation of SOAP Fault Sub Code. But received some other implementation");
+        if (!((parent instanceof SOAP11FaultSubCodeImpl) || (parent instanceof SOAP11FaultCodeImpl))) {
+            throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Sub Code. But received some other implementation");
         }
         super.setSubCode(subCode);
     }
 
     public void setValue(SOAPFaultValue soapFaultSubCodeValue) throws SOAPProcessingException {
         if (!(soapFaultSubCodeValue instanceof SOAP11FaultValueImpl)) {
-            throw new SOAPProcessingException(
-                    "Expecting SOAP 1.1 implementation of SOAP Fault Value. But received some other implementation");
+            throw new SOAPProcessingException("Expecting SOAP 1.1 implementation of SOAP Fault Value. But received some other implementation");
         }
         super.setValue(soapFaultSubCodeValue);
     }

Modified: webservices/axis/trunk/java/modules/xml/test-resources/mtom/MTOMBuilderTestIn.txt
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test-resources/mtom/MTOMBuilderTestIn.txt?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test-resources/mtom/MTOMBuilderTestIn.txt (original)
+++ webservices/axis/trunk/java/modules/xml/test-resources/mtom/MTOMBuilderTestIn.txt Tue Jul 26 00:51:27 2005
@@ -3,9 +3,10 @@
 Content-Transfer-Encoding: 8bit
 Content-ID: SOAPPart
 
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><m:data xmlns:m="http://www.example.org/stuff"><m:name m:contentType="text/plain"><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/Include" href="cid:-1609420109260943731"></xop:Include></m:name></m:data></soapenv:Body></soapenv:Envelope>
+<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope"><soapenv:Body><m:data xmlns:m="http://www.example.org/stuff"><m:name m:contentType="text/plain"><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/Include" href="cid:-1609420109260943731"></xop:Include></m:name></m:data></soapenv:Body></soapenv:Envelope>
 ------=_AxIs2_Def_boundary_=42214532
 Content-Transfer-Encoding: binary
 Content-ID: -1609420109260943731
-
8A ???b
+
+8A ???b
 ------=_AxIs2_Def_boundary_=42214532--

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/attachments/ImageSampleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/attachments/ImageSampleTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/attachments/ImageSampleTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/attachments/ImageSampleTest.java Tue Jul 26 00:51:27 2005
@@ -128,7 +128,7 @@
                                 new InputStreamReader(
                                         mimeHelper
                 .getSOAPPartInputStream())));
-        builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper);
+        builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper, null);
         OMElement root = (OMElement) builder.getDocumentElement();
         OMElement body = (OMElement) root.getFirstChild();
         OMElement data = (OMElement) body.getFirstChild();

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/IteratorTester.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/IteratorTester.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/IteratorTester.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/IteratorTester.java Tue Jul 26 00:51:27 2005
@@ -35,7 +35,7 @@
                         XMLInputFactory.newInstance().createXMLStreamReader(
                                 new FileReader(
                                         getTestResourceFile(
-                                                "soap/soapmessage1.xml")))).getSOAPEnvelope();
+                                                "soap/soapmessage1.xml"))), null).getSOAPEnvelope();
     }
 
     protected void tearDown() throws Exception {

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMChildrenQNameIteratorTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMChildrenQNameIteratorTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMChildrenQNameIteratorTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMChildrenQNameIteratorTest.java Tue Jul 26 00:51:27 2005
@@ -41,7 +41,7 @@
                         XMLInputFactory.newInstance().createXMLStreamReader(
                                 new FileReader(
                                         getTestResourceFile(
-                                                "soap/soapmessage1.xml"))));
+                                                "soap/soapmessage1.xml"))), null);
         envelope = stAXSOAPModelBuilder.getSOAPEnvelope();
     }
 

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMNavigatorTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMNavigatorTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMNavigatorTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMNavigatorTest.java Tue Jul 26 00:51:27 2005
@@ -45,7 +45,7 @@
                         new FileReader(
                                 getTestResourceFile("soap/soapmessage1.xml")));
         SOAPFactory factory = OMAbstractFactory.getSOAP11Factory();
-        builder = new StAXSOAPModelBuilder(xmlStreamReader);
+        builder = new StAXSOAPModelBuilder(xmlStreamReader, null);
         envelope = (SOAPEnvelope) builder.getDocumentElement();
         tempFile = File.createTempFile("temp", "xml");
         output =

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTest.java Tue Jul 26 00:51:27 2005
@@ -44,7 +44,7 @@
         XMLStreamReader parser = XMLInputFactory.newInstance()
                 .createXMLStreamReader(new FileReader(file));
         fac = OMAbstractFactory.getSOAP11Factory();
-        OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser);
+        OMXMLParserWrapper builder = new StAXSOAPModelBuilder(parser, null);
         envelope = (SOAPEnvelope) builder.getDocumentElement();
     }
 

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestCase.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestCase.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/OMTestCase.java Tue Jul 26 00:51:27 2005
@@ -54,14 +54,14 @@
         XMLStreamReader parser = XMLInputFactory.newInstance()
                 .createXMLStreamReader(
                         new FileReader(getTestResourceFile(fileName)));
-        builder = new StAXSOAPModelBuilder(parser);
+        builder = new StAXSOAPModelBuilder(parser, null);
         return builder;
     }
 
     protected StAXSOAPModelBuilder getOMBuilder(InputStream in) throws Exception {
         XMLStreamReader parser = XMLInputFactory.newInstance()
                 .createXMLStreamReader(in);
-        builder = new StAXSOAPModelBuilder(parser);
+        builder = new StAXSOAPModelBuilder(parser, null);
         return builder;
     }
 

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilderTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilderTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/om/impl/llom/mtom/MTOMStAXSOAPModelBuilderTest.java Tue Jul 26 00:51:27 2005
@@ -21,6 +21,7 @@
 import org.apache.axis2.om.OMElement;
 import org.apache.axis2.om.OMText;
 import org.apache.axis2.om.OMXMLParserWrapper;
+import org.apache.axis2.soap.impl.llom.soap12.SOAP12Constants;
 
 import javax.activation.DataHandler;
 import javax.xml.stream.XMLInputFactory;
@@ -54,21 +55,16 @@
     protected void setUp() throws Exception {
         super.setUp();
         inFileName = "mtom/MTOMBuilderTestIn.txt";
-        InputStream inStream = new FileInputStream(
-                getTestResourceFile(inFileName));
+        InputStream inStream = new FileInputStream(getTestResourceFile(inFileName));
         mimeHelper = new MIMEHelper(inStream, contentTypeString);
         XMLStreamReader reader = XMLInputFactory.newInstance()
-                .createXMLStreamReader(
-                        new BufferedReader(
-                                new InputStreamReader(
-                                        mimeHelper
+                .createXMLStreamReader(new BufferedReader(new InputStreamReader(mimeHelper
                 .getSOAPPartInputStream())));
-        builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper);
-
+        builder = new MTOMStAXSOAPModelBuilder(reader, mimeHelper, SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
     }
 
     public void testCreateOMElement() throws Exception {
-        OMElement root = (OMElement) builder.getDocumentElement();
+        OMElement root = builder.getDocumentElement();
         System.out.println(root.getLocalName() + " : "
                 + root.getNamespace().getName());
         OMElement body = (OMElement) root.getFirstChild();

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPTestCase.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPTestCase.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/SOAPTestCase.java Tue Jul 26 00:51:27 2005
@@ -76,7 +76,7 @@
         } catch (FileNotFoundException e) {
             e.printStackTrace();
         }
-        return new StAXSOAPModelBuilder(parser);
+        return new StAXSOAPModelBuilder(parser, null);
     }
 
 }

Modified: webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java?rev=225253&r1=225252&r2=225253&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java (original)
+++ webservices/axis/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/builder/StAXSOAPModelBuilderTest.java Tue Jul 26 00:51:27 2005
@@ -131,8 +131,7 @@
         try {
             XMLStreamReader sopa12Parser = XMLInputFactory.newInstance()
                     .createXMLStreamReader(new StringReader(soap12Message));
-            OMXMLParserWrapper soap12Builder = new StAXSOAPModelBuilder(
-                    sopa12Parser);
+            OMXMLParserWrapper soap12Builder = new StAXSOAPModelBuilder(sopa12Parser, null);
             SOAPEnvelope soap12Envelope = (SOAPEnvelope) soap12Builder.getDocumentElement();
 //            soap12Envelope.build();
 //            XMLStreamWriter writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
@@ -374,8 +373,7 @@
 
             XMLStreamReader sopa11Parser = XMLInputFactory.newInstance()
                     .createXMLStreamReader(new StringReader(soap11Message));
-            OMXMLParserWrapper soap11Builder = new StAXSOAPModelBuilder(
-                    sopa11Parser);
+            OMXMLParserWrapper soap11Builder = new StAXSOAPModelBuilder(sopa11Parser, null);
             SOAPEnvelope soap11Envelope = (SOAPEnvelope) soap11Builder.getDocumentElement();
 //            soap11Envelope.build();
 //            writer = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);



Mime
View raw message