servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r594063 - in /incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src: main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
Date Mon, 12 Nov 2007 09:37:32 GMT
Author: gertv
Date: Mon Nov 12 01:37:17 2007
New Revision: 594063

URL: http://svn.apache.org/viewvc?rev=594063&view=rev
Log:
SM-1119: Encoding problem in HTTP SU response

Added:
    incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
Modified:
    incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java

Modified: incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java?rev=594063&r1=594062&r2=594063&view=diff
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
(original)
+++ incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/main/java/org/apache/servicemix/soap/marshalers/SoapWriter.java
Mon Nov 12 01:37:17 2007
@@ -97,7 +97,7 @@
             parts = new MimeMultipart("related; type=\"text/xml\"; start=\"<" + SOAP_PART_ID
+ ">\"");
             return parts.getContentType();
         } else {
-            return "text/xml";
+            return "text/xml;charset=utf-8";
         }
     }
 

Added: incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java?rev=594063&view=auto
==============================================================================
--- incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
(added)
+++ incubator/servicemix/branches/servicemix-3.1/common/servicemix-soap/src/test/java/org/apache/servicemix/soap/marshalers/SoapWriterTest.java
Mon Nov 12 01:37:17 2007
@@ -0,0 +1,38 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.servicemix.soap.marshalers;
+
+import javax.activation.DataHandler;
+
+import junit.framework.TestCase;
+
+public class SoapWriterTest extends TestCase {
+			
+	public void testGetContentTypeSimpleMessage() throws Exception {
+		SoapWriter writer = new SoapWriter(new SoapMarshaler(), new SoapMessage());
+		assertEquals("text/xml;charset=utf-8", writer.getContentType());
+	}
+	
+	public void testGetContentTypeComplexMessage() throws Exception {
+		SoapMessage message = new SoapMessage();
+		DataHandler handler = new DataHandler(new Object(), "mime/type");
+		message.addAttachment("attachment", handler);
+		
+		SoapWriter writer = new SoapWriter(new SoapMarshaler(), message);
+		assertTrue(writer.getContentType().startsWith("multipart/related; type=\"text/xml\""));
	
+	}
+}



Mime
View raw message