axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r395492 - in /webservices/axis2/trunk/java/modules: core/src/org/apache/axis2/transport/ integration/test/org/apache/axis2/mtom/ integration/test/org/apache/axis2/swa/ saaj/src/org/apache/axis2/saaj/
Date Thu, 20 Apr 2006 05:32:49 GMT
Author: dims
Date: Wed Apr 19 22:32:49 2006
New Revision: 395492

URL: http://svn.apache.org/viewcvs?rev=395492&view=rev
Log:
voila! we have an Class/API for accessing the attachments :)

Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoService2.java
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
    webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java?rev=395492&r1=395491&r2=395492&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/TransportUtils.java
Wed Apr 19 22:32:49 2006
@@ -17,7 +17,7 @@
 
 package org.apache.axis2.transport;
 
-import org.apache.axiom.attachments.MIMEHelper;
+import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.impl.MTOMConstants;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
@@ -197,11 +197,11 @@
                     : parameter.getValue().toString();
         }
 
-        MIMEHelper mimeHelper = new MIMEHelper(inStream, contentTypeString,
+        Attachments attachments = new Attachments(inStream, contentTypeString,
                 fileCacheForAttachments, attachmentRepoDir,
                 attachmentSizeThreshold);
         String charSetEncoding =
-                getCharSetEncoding(mimeHelper.getSOAPPartContentType());
+                getCharSetEncoding(attachments.getSOAPPartContentType());
         XMLStreamReader streamReader;
 
         if ((charSetEncoding == null) || "null".equalsIgnoreCase(charSetEncoding)) {
@@ -210,7 +210,7 @@
 
         try {
             streamReader = XMLInputFactory.newInstance().createXMLStreamReader(
-                    getReader(mimeHelper.getSOAPPartInputStream(), charSetEncoding));
+                    getReader(attachments.getSOAPPartInputStream(), charSetEncoding));
         } catch (IOException e) {
             throw new XMLStreamException(e);
         }
@@ -220,15 +220,15 @@
         /*
         * put a reference to Attachments in to the message context
         */
-        msgContext.setProperty(MTOMConstants.ATTACHMENTS, mimeHelper);
+        msgContext.setProperty(MTOMConstants.ATTACHMENTS, attachments);
 
-        if (mimeHelper.getAttachmentSpecType().equals(MTOMConstants.MTOM_TYPE)) {
+        if (attachments.getAttachmentSpecType().equals(MTOMConstants.MTOM_TYPE)) {
 
             /*
             * Creates the MTOM specific MTOMStAXSOAPModelBuilder
             */
-            builder = new MTOMStAXSOAPModelBuilder(streamReader, mimeHelper, null);
-        } else if (mimeHelper.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE)) {
+            builder = new MTOMStAXSOAPModelBuilder(streamReader, attachments, null);
+        } else if (attachments.getAttachmentSpecType().equals(MTOMConstants.SWA_TYPE)) {
             builder = new StAXSOAPModelBuilder(streamReader,
                     SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
         }

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoService2.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoService2.java?rev=395492&r1=395491&r2=395492&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoService2.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mtom/EchoService2.java
Wed Apr 19 22:32:49 2006
@@ -1,20 +1,13 @@
 package org.apache.axis2.mtom;
 
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.util.Iterator;
-
-import javax.activation.DataHandler;
-
 import org.apache.axiom.attachments.IncomingAttachmentInputStream;
 import org.apache.axiom.attachments.IncomingAttachmentStreams;
-import org.apache.axiom.attachments.MIMEHelper;
+import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.attachments.utils.IOUtils;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMText;
 import org.apache.axiom.om.util.Base64;
 import org.apache.axiom.om.impl.MTOMConstants;
 import org.apache.axis2.AxisFault;
@@ -31,16 +24,16 @@
 
     public OMElement mtomSample(OMElement element) throws Exception {
 
-        MIMEHelper mimeHelper = null;
+        Attachments attachments = null;
 
         if (this.oprCtx != null) {
-            mimeHelper = (MIMEHelper) this.oprCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getProperty(MTOMConstants.ATTACHMENTS);
+            attachments = (Attachments) this.oprCtx.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getProperty(MTOMConstants.ATTACHMENTS);
         } else {
-            throw new AxisFault("Message context not set/MIMEHelper not set");
+            throw new AxisFault("Message context not set/Attachments not set");
         }
 
         // Get image data
-        IncomingAttachmentStreams streams = mimeHelper.getIncomingAttachmentStreams();
+        IncomingAttachmentStreams streams = attachments.getIncomingAttachmentStreams();
         IncomingAttachmentInputStream stream = streams.getNextStream();
 
         byte[] data = IOUtils.getStreamAsByteArray(stream);

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java?rev=395492&r1=395491&r2=395492&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
(original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/swa/EchoSwA.java
Wed Apr 19 22:32:49 2006
@@ -16,7 +16,7 @@
 
 package org.apache.axis2.swa;
 
-import org.apache.axiom.attachments.MIMEHelper;
+import org.apache.axiom.attachments.Attachments;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMText;
@@ -48,7 +48,7 @@
         OMElement child = (OMElement) omEle.getFirstOMChild();
         OMAttribute attr = child.getAttribute(new QName("href"));
         String contentID = attr.getAttributeValue();
-        MIMEHelper attachment = (MIMEHelper) msgcts.getProperty(MTOMConstants.ATTACHMENTS);
+        Attachments attachment = (Attachments) msgcts.getProperty(MTOMConstants.ATTACHMENTS);
         contentID = contentID.trim();
 
         if (contentID.substring(0, 3).equalsIgnoreCase("cid")) {

Modified: webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java?rev=395492&r1=395491&r2=395492&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/saaj/src/org/apache/axis2/saaj/SOAPConnectionImpl.java
Wed Apr 19 22:32:49 2006
@@ -150,8 +150,6 @@
 
             MessageContext msgCtx = opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
             //TODO: get attachments
-//            MIMEHelper mimeHelper = (MIMEHelper) msgCtx.getProperty(MTOMConstants.ATTACHMENTS);
-//            mimeHelper.getAllContentIDs();
 
             return getSOAPMessage(msgCtx.getEnvelope());
         } catch (AxisFault e) {



Mime
View raw message