ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thil...@apache.org
Subject svn commit: r440000 - in /webservices/commons/trunk/modules/axiom/modules: axiom-api/src/main/java/org/apache/axiom/attachments/ axiom-api/src/main/java/org/apache/axiom/attachments/utils/ axiom-api/src/main/java/org/apache/axiom/om/ axiom-api/src/main...
Date Mon, 04 Sep 2006 09:51:06 GMT
Author: thilina
Date: Mon Sep  4 02:51:04 2006
New Revision: 440000

URL: http://svn.apache.org/viewvc?view=rev&rev=440000
Log:
Removing ImageIO & ImageDataSource, which were giving troubles to some users. People can
use native java classes to achieve the functionality provided by these classes.
Moving DataHandler utils to a more suitable home.
Moved the contentType generation logic to OMOutputFormat, which is the only class uses it.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/DataHandlerUtils.java
  (with props)
Removed:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/DataHandlerUtils.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/ImageDataSource.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/ImageIO.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/ImageSampleTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/MIMEHelperTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/MIMEOutputUtilsTest.java

Added: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/DataHandlerUtils.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/DataHandlerUtils.java?view=auto&rev=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/DataHandlerUtils.java
(added)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/DataHandlerUtils.java
Mon Sep  4 02:51:04 2006
@@ -0,0 +1,39 @@
+/*
+ * Copyright  2004 The Apache Software Foundation.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ *
+ */
+package org.apache.axiom.attachments.utils;
+
+
+import org.apache.axiom.attachments.ByteArrayDataSource;
+import org.apache.axiom.om.util.Base64;
+
+import javax.activation.DataHandler;
+
+public class DataHandlerUtils {
+
+  public static Object getDataHandlerFromText(String value, String mimeType)
+  {
+      ByteArrayDataSource dataSource;
+      byte[] data = Base64.decode(value);
+      if (mimeType != null) {
+          dataSource = new ByteArrayDataSource(data, mimeType);
+      } else {
+          // Assumes type as application/octet-stream
+          dataSource = new ByteArrayDataSource(data);
+      }
+      return new DataHandler(dataSource);
+  }
+}

Propchange: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/utils/DataHandlerUtils.java
------------------------------------------------------------------------------
    svn:executable = *

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
Mon Sep  4 02:51:04 2006
@@ -16,7 +16,6 @@
 
 package org.apache.axiom.om;
 
-import org.apache.axiom.om.impl.MIMEOutputUtils;
 import org.apache.axiom.om.util.UUIDGenerator;
 import org.apache.axiom.soap.SOAP11Constants;
 import org.apache.axiom.soap.SOAP12Constants;
@@ -24,12 +23,17 @@
 
 /**
  * Formats options for OM Output.
+ * 
+ * Setting of all the properties in a OMOutputFormat should be done before
+ * calling the getContentType() method. It is advised to set all the properties
+ * at the creation time of the OMOutputFormat and not to change them later.
  */
 public class OMOutputFormat {
     private String mimeBoundary = null;
     private String rootContentId = null;
     private int nextid = 0;
     private boolean doOptimize;
+    private boolean doingSWA;
     private boolean isSoap11 = true;
 
     /**
@@ -58,10 +62,7 @@
             } else {
                 SOAPContentType = SOAP12Constants.SOAP_12_CONTENT_TYPE;
             }
-            return MIMEOutputUtils.getContentTypeForMime(
-                    getMimeBoundary(),
-                    getRootContentId(),
-                    this.getCharSetEncoding(), SOAPContentType);
+            return this.getContentTypeForMime(SOAPContentType);
         } else {
             if (!isSoap11) {
                 return SOAP12Constants.SOAP_12_CONTENT_TYPE;
@@ -140,4 +141,27 @@
     public void setDoOptimize(boolean b) {
         doOptimize = b;
     }
+
+	public boolean isDoingSWA() {
+		return doingSWA;
+	}
+
+	public void setDoingSWA(boolean doingSWA) {
+		this.doingSWA = doingSWA;
+	}
+
+	public String getContentTypeForMime(String SOAPContentType) {
+	    StringBuffer sb = new StringBuffer();
+	    sb.append("multipart/related");
+	    sb.append("; ");
+	    sb.append("boundary=");
+	    sb.append(getMimeBoundary());
+	    sb.append("; ");
+	    sb.append("type=\"application/xop+xml\"");
+	    sb.append("; ");
+	    sb.append("start=\"<" + getRootContentId() + ">\"");
+	    sb.append("; ");
+	    sb.append("start-info=\""+SOAPContentType+"\"");
+	    return sb.toString();
+	}
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/MIMEOutputUtils.java
Mon Sep  4 02:51:04 2006
@@ -16,6 +16,7 @@
 
 package org.apache.axiom.om.impl;
 
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMText;
 
@@ -27,6 +28,7 @@
 import java.io.StringWriter;
 import java.util.Iterator;
 import java.util.LinkedList;
+import java.util.Map;
 
 public class MIMEOutputUtils {
 
@@ -122,18 +124,8 @@
         outStream.write(new byte[]{45, 45});
     }
 
-    public static String getContentTypeForMime(String boundary, String contentId, String
charSetEncoding, String SOAPContentType) {
-        StringBuffer sb = new StringBuffer();
-        sb.append("multipart/related");
-        sb.append("; ");
-        sb.append("boundary=");
-        sb.append(boundary);
-        sb.append("; ");
-        sb.append("type=\"application/xop+xml\"");
-        sb.append("; ");
-        sb.append("start=\"<" + contentId + ">\"");
-        sb.append("; ");
-        sb.append("start-info=\""+SOAPContentType+"\"");
-        return sb.toString();
+    public static void writeSOAPWithAttachementsMessage(OMElement element,OutputStream outputStream,
Map attachmentMap)
+    {
+    	
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextImpl.java
Mon Sep  4 02:51:04 2006
@@ -15,7 +15,7 @@
  */
 package org.apache.axiom.om.impl.dom;
 
-import org.apache.axiom.attachments.DataHandlerUtils;
+import org.apache.axiom.attachments.utils.DataHandlerUtils;
 import org.apache.axiom.om.*;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 import org.apache.axiom.om.impl.OMNamespaceImpl;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
Mon Sep  4 02:51:04 2006
@@ -335,7 +335,7 @@
     public Object getDataHandler() {
         if ((value != null || charArray != null || textNS != null) & isBinary) {
             String text = textNS == null ? getTextFromProperPlace() : getTextString();
-            return org.apache.axiom.attachments.DataHandlerUtils.getDataHandlerFromText(text,
mimeType);
+            return org.apache.axiom.attachments.utils.DataHandlerUtils.getDataHandlerFromText(text,
mimeType);
         } else {
 
             if (dataHandlerObject == null) {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/ImageSampleTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/ImageSampleTest.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/ImageSampleTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/ImageSampleTest.java
Mon Sep  4 02:51:04 2006
@@ -16,8 +16,27 @@
 
 package org.apache.axiom.attachments;
 
-import org.apache.axiom.attachments.utils.ImageDataSource;
-import org.apache.axiom.attachments.utils.ImageIO;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.util.Iterator;
+
+import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
+import javax.imageio.IIOImage;
+import javax.imageio.ImageIO;
+import javax.imageio.ImageWriter;
+import javax.imageio.stream.ImageOutputStream;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
+
 import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
@@ -29,16 +48,7 @@
 import org.apache.axiom.om.impl.llom.OMTextImpl;
 import org.apache.axiom.om.impl.mtom.MTOMStAXSOAPModelBuilder;
 
-import javax.activation.DataHandler;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamReader;
-import java.awt.*;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.io.InputStreamReader;
+import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
 
 public class ImageSampleTest extends AbstractTestCase {
 
@@ -92,12 +102,7 @@
                 "http://www.example.org/stuff", "m");
         OMElement data = new OMElementImpl("data", dataName, fac);
 
-        expectedImage =
-                new ImageIO().loadImage(
-                        new FileInputStream(
-                                getTestResourceFile(imageInFileName)));
-        ImageDataSource dataSource = new ImageDataSource("WaterLilies.jpg",
-                expectedImage);
+        FileDataSource dataSource = new FileDataSource(getTestResourceFile(imageInFileName));
         expectedDH = new DataHandler(dataSource);
         OMText binaryNode = new OMTextImpl(expectedDH, true, fac);
 
@@ -133,12 +138,32 @@
 
         DataHandler actualDH;
         actualDH = (DataHandler)blob.getDataHandler();
-        Image actualObject = new ImageIO().loadImage(actualDH.getDataSource()
-                .getInputStream());
-        FileOutputStream imageOutStream = new FileOutputStream(
-                new File(imageOutFileName));
-        new ImageIO().saveImage("image/jpeg", actualObject, imageOutStream);
-
+        BufferedImage bufferedImage = ImageIO.read(actualDH.getDataSource().getInputStream());
+        ImageWriter writer = null;
+        this.saveImage("image/jpeg",bufferedImage, new FileOutputStream(imageOutFileName)
);
     }
+	/**
+     * Saves an image.
+     *
+     * @param mimeType the mime-type of the format to save the image
+     * @param image    the image to save
+     * @param os       the stream to write to
+     * @throws Exception if an error prevents image encoding
+     */
+    public void saveImage(String mimeType, BufferedImage image, OutputStream os)
+            throws Exception {
+
+        ImageWriter writer = null;
+        Iterator iter = javax.imageio.ImageIO.getImageWritersByMIMEType(mimeType);
+        if (iter.hasNext()) {
+            writer = (ImageWriter) iter.next();
+        }
+        ImageOutputStream ios = javax.imageio.ImageIO.createImageOutputStream(os);
+        writer.setOutput(ios);
+        
+        writer.write(new IIOImage(image, null, null));
+        ios.flush();
+        writer.dispose();
+    } // saveImage
 
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/MIMEHelperTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/MIMEHelperTest.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/MIMEHelperTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/attachments/MIMEHelperTest.java
Mon Sep  4 02:51:04 2006
@@ -16,16 +16,15 @@
 
 package org.apache.axiom.attachments;
 
-import java.awt.Image;
+import java.io.ByteArrayOutputStream;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
 import java.util.Arrays;
 
 import javax.activation.DataHandler;
-import javax.imageio.ImageIO;
+import javax.activation.FileDataSource;
 
-import org.apache.axiom.attachments.utils.ImageDataSource;
-import org.apache.axiom.attachments.utils.IOUtils;
 import org.apache.axiom.om.AbstractTestCase;
 
 public class MIMEHelperTest extends AbstractTestCase {
@@ -113,9 +112,8 @@
 
     public void testGetInputAttachhmentStreams() throws Exception {
 
-        Image expectedImage;
         IncomingAttachmentInputStream dataIs;
-        ImageDataSource dataSource;
+        FileDataSource dataSource;
         InputStream expectedDataIs;
 
         InputStream inStream = new FileInputStream(getTestResourceFile(inMimeFileName));
@@ -131,14 +129,12 @@
         IncomingAttachmentStreams ias = attachments.getIncomingAttachmentStreams();
 
         dataIs = ias.getNextStream();
-        expectedImage = ImageIO.read(new FileInputStream(getTestResourceFile(img1FileName)));
-        dataSource = new ImageDataSource("test1.jpg", expectedImage);
+        dataSource = new FileDataSource(getTestResourceFile(img1FileName));
         expectedDataIs = dataSource.getInputStream();
         compareStreams(dataIs, expectedDataIs);
 
         dataIs = ias.getNextStream();
-        expectedImage = ImageIO.read(new FileInputStream(getTestResourceFile(img2FileName)));
-        dataSource = new ImageDataSource("test2.jpg", expectedImage);
+        dataSource = new FileDataSource(getTestResourceFile(img2FileName));
         expectedDataIs = dataSource.getInputStream();
         compareStreams(dataIs, expectedDataIs);
 
@@ -152,8 +148,8 @@
     }
 
     private void compareStreams(InputStream data, InputStream expected) throws Exception
{
-        byte[] dataArray = IOUtils.getStreamAsByteArray(data);
-        byte[] expectedArray = IOUtils.getStreamAsByteArray(expected);
+        byte[] dataArray = this.getStreamAsByteArray(data,-1);
+        byte[] expectedArray = this.getStreamAsByteArray(expected,-1);
         if(dataArray.length == expectedArray.length) {
             assertTrue(Arrays.equals(dataArray, expectedArray));
         } else {
@@ -169,11 +165,36 @@
         DataHandler dh = attachments.getDataHandler("2.urn:uuid:A3ADBAEE51A1A87B2A11443668160994@apache.org");
         InputStream dataIs = dh.getDataSource().getInputStream();
 
-        Image expectedImage = ImageIO.read(new FileInputStream(getTestResourceFile(img2FileName)));
-        ImageDataSource dataSource = new ImageDataSource("test.jpg", expectedImage);
+        FileDataSource dataSource = new FileDataSource(getTestResourceFile(img2FileName));
         InputStream expectedDataIs = dataSource.getInputStream();
 
         // Compare data across streams
         compareStreams(dataIs, expectedDataIs);
+    }
+    
+    /**
+     * Returns the contents of the input stream as byte array.
+     *
+     * @param stream the <code>InputStream</code>
+     * @param length the number of bytes to copy, if length < 0,
+     *               the number is unlimited
+     * @return the stream content as byte array
+     */
+    private byte[] getStreamAsByteArray(InputStream stream, int length) throws IOException
{
+        if (length == 0) return new byte[0];
+        boolean checkLength = true;
+        if (length < 0) {
+            length = Integer.MAX_VALUE;
+            checkLength = false;
+        }
+        ByteArrayOutputStream byteStream = new ByteArrayOutputStream();
+        int nextValue = stream.read();
+        if (checkLength) length--;
+        while (-1 != nextValue && length >= 0) {
+            byteStream.write(nextValue);
+            nextValue = stream.read();
+            if (checkLength) length--;
+        }
+        return byteStream.toByteArray();
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/IteratorTest.java
Mon Sep  4 02:51:04 2006
@@ -16,19 +16,17 @@
 
 package org.apache.axiom.om;
 
-import org.apache.axiom.attachments.utils.ImageDataSource;
-import org.apache.axiom.attachments.utils.ImageIO;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
+import java.io.File;
+import java.io.FileReader;
+import java.util.Iterator;
 
 import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLInputFactory;
-import java.awt.*;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.util.Iterator;
+
+import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
 
 public class IteratorTest extends AbstractTestCase {
     private OMElement envelope = null;
@@ -210,12 +208,8 @@
 
             OMElement data = fac.createOMElement("mtomSample", omNs);
             OMElement image = fac.createOMElement("image", omNs);
-            Image expectedImage;
-            expectedImage = new ImageIO()
-                    .loadImage(new FileInputStream(imageSource));
-
-            ImageDataSource dataSource = new ImageDataSource("test.jpg",
-                    expectedImage);
+ 
+            FileDataSource dataSource = new FileDataSource(imageSource);
             DataHandler expectedDH = new DataHandler(dataSource);
             OMText textData = fac.createOMText(expectedDH, true);
             image.addChild(textData);
@@ -229,7 +223,7 @@
 
             return data;
         } catch (Exception e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings
| File Templates.
+            e.printStackTrace(); 
         }
 
         return null;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/MIMEOutputUtilsTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/MIMEOutputUtilsTest.java?view=diff&rev=440000&r1=439999&r2=440000
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/MIMEOutputUtilsTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/MIMEOutputUtilsTest.java
Mon Sep  4 02:51:04 2006
@@ -45,10 +45,9 @@
         
         OMOutputFormat omOutput = new OMOutputFormat();
         boundary = omOutput.getMimeBoundary();
+        omOutput.setSOAP11(false);
 
-        String contentType = org.apache.axiom.om.impl.MIMEOutputUtils
-				.getContentTypeForMime(boundary, omOutput.getRootContentId(),
-						omOutput.getCharSetEncoding(),SOAP12Constants.SOAP_12_CONTENT_TYPE);
+        String contentType = omOutput.getContentType();
         DataHandler dataHandler;
         dataHandler = new DataHandler(new ByteArrayDataSource(byteArray));
         OMText textData = factory.createOMText(dataHandler, true);



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


Mime
View raw message