axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thil...@apache.org
Subject svn commit: r453545 - in /webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport: TransportUtils.java http/HTTPTransportUtils.java http/util/RESTUtil.java jms/JMSUtils.java
Date Fri, 06 Oct 2006 10:25:31 GMT
Author: thilina
Date: Fri Oct  6 03:25:29 2006
New Revision: 453545

URL: http://svn.apache.org/viewvc?view=rev&rev=453545
Log:
Reflecting Axiom changes
Fixing http://issues.apache.org/jira/browse/WSCOMMONS-107.

Modified:
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
    webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java?view=diff&rev=453545&r1=453544&r2=453545
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/TransportUtils.java
Fri Oct  6 03:25:29 2006
@@ -23,11 +23,12 @@
 import org.apache.axiom.om.impl.MTOMConstants;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.mtom.MTOMStAXSOAPModelBuilder;
+import org.apache.axiom.om.impl.builder.XOPAwareStAXOMBuilder;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
+import org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder;
 import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
 import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory;
 import org.apache.axis2.AxisFault;
@@ -95,7 +96,7 @@
             if (contentType != null) {
                 msgContext.setDoingMTOM(true);
                 builder = selectBuilderForMIME(msgContext, inStream,
-                        (String) contentType);
+                        (String) contentType,true);
                 envelope = (SOAPEnvelope) builder.getDocumentElement();
             } else if (msgContext.isDoingREST()) {
                 XMLStreamReader xmlreader =
@@ -166,7 +167,7 @@
     }
 
 	public static StAXBuilder selectBuilderForMIME(MessageContext msgContext,
-			InputStream inStream, String contentTypeString) throws OMException,
+			InputStream inStream, String contentTypeString,boolean isSOAP) throws OMException,
 			XMLStreamException, FactoryConfigurationError {
 		StAXBuilder builder = null;
 
@@ -241,8 +242,8 @@
         msgContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING, charSetEncoding);
 
         /*
-        * put a reference to Attachments in to the message context
-        * Leaving this out for backword compatibility with 1.0
+        * Put a reference to Attachments Map in to the message context 
+        * For backword compatibility with Axis2 1.0
         */
         msgContext.setProperty(MTOMConstants.ATTACHMENTS, attachments);
         
@@ -259,6 +260,8 @@
         	soapEnvelopeNamespaceURI = SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI;
         }
         
+        if (isSOAP)   
+        {
         if (attachments.getAttachmentSpecType().equals(MTOMConstants.MTOM_TYPE)& null!=soapEnvelopeNamespaceURI)
{
 
             /*
@@ -269,6 +272,18 @@
         } else if (attachments.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE)&
null!=soapEnvelopeNamespaceURI) {
             builder = new StAXSOAPModelBuilder(streamReader,
                     soapEnvelopeNamespaceURI);
+        }
+        }
+        // To handle REST XOP case
+        else
+        {
+            if (attachments.getAttachmentSpecType().equals(MTOMConstants.MTOM_TYPE)) {  
         
+                XOPAwareStAXOMBuilder stAXOMBuilder = new XOPAwareStAXOMBuilder(streamReader,attachments);
+                builder= stAXOMBuilder;
+            	 
+            } else if (attachments.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE))
{
+                builder = new StAXOMBuilder(streamReader);
+            }
         }
 
         return builder;

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java?view=diff&rev=453545&r1=453544&r2=453545
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/HTTPTransportUtils.java
Fri Oct  6 03:25:29 2006
@@ -193,9 +193,8 @@
 
             if (contentType != null) {
                 if (contentType.indexOf(HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) >
-1) {
-
                     // It is MIME (MTOM or SwA)
-                    builder = TransportUtils.selectBuilderForMIME(msgContext, in, contentType);
+                    builder = TransportUtils.selectBuilderForMIME(msgContext, in, contentType,true);
                     envelope = (SOAPEnvelope) builder.getDocumentElement();
                 } else {
                     XMLStreamReader xmlreader;

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java?view=diff&rev=453545&r1=453544&r2=453545
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/http/util/RESTUtil.java
Fri Oct  6 03:25:29 2006
@@ -206,7 +206,7 @@
             } else if (checkContentType(org.apache.axis2.transport.http.HTTPConstants.MEDIA_TYPE_MULTIPART_RELATED,
contentType)) {
                 body.addChild(TransportUtils.selectBuilderForMIME(msgCtxt,
                         inputStream,
-                        contentType).getDocumentElement());
+                        contentType,false).getDocumentElement());
             }
 
             return soapEnvelope;

Modified: webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java?view=diff&rev=453545&r1=453544&r2=453545
==============================================================================
--- webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
(original)
+++ webservices/axis2/branches/java/1_1/modules/kernel/src/org/apache/axis2/transport/jms/JMSUtils.java
Fri Oct  6 03:25:29 2006
@@ -303,7 +303,7 @@
                 HTTPConstants.HEADER_ACCEPT_MULTIPART_RELATED) > -1) {
                 // It is MTOM
                 builder = TransportUtils.selectBuilderForMIME(
-                    msgContext, in, contentType);
+                    msgContext, in, contentType,true);
                 envelope = (SOAPEnvelope) builder.getDocumentElement();
 
             } else {



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