servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r482787 - in /incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src: main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
Date Tue, 05 Dec 2006 21:24:48 GMT
Author: gnodet
Date: Tue Dec  5 13:24:46 2006
New Revision: 482787

URL: http://svn.apache.org/viewvc?view=rev&rev=482787
Log:
SM-766: Error with latin characters in jsr181
Patch provided by Jorge Rodríguez Pedrianes. Thx !

Modified:
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
    incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java?view=diff&rev=482787&r1=482786&r2=482787
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
(original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/main/java/org/apache/servicemix/jsr181/Jsr181ExchangeProcessor.java
Tue Dec  5 13:24:46 2006
@@ -115,9 +115,10 @@
         
         // Set response or DONE status
         if (isInAndOut(exchange)) {
+            String charSet = ctx.getOutMessage().getEncoding();
             if (ctx.getExchange().hasFaultMessage() && ctx.getExchange().getFaultMessage().getBody()
!= null) {
                 Fault fault = exchange.createFault();
-                fault.setContent(new StringSource(out.toString()));
+                fault.setContent(new StringSource(out.toString(charSet)));
                 XFireFault xFault = (XFireFault) ctx.getExchange().getFaultMessage().getBody();
                 fault.setProperty(SOAP_FAULT_CODE, xFault.getFaultCode());
                 fault.setProperty(SOAP_FAULT_REASON, xFault.getReason());
@@ -133,7 +134,7 @@
                         outMsg.addAttachment(att.getId(), att.getDataHandler());
                     }
                 }
-                outMsg.setContent(new StringSource(out.toString()));
+                outMsg.setContent(new StringSource(out.toString(charSet)));
                 exchange.setMessage(outMsg, "out");
             }
             if (exchange.isTransacted() && Boolean.TRUE.equals(exchange.getProperty(JbiConstants.SEND_SYNC)))
{

Modified: incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
URL: http://svn.apache.org/viewvc/incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java?view=diff&rev=482787&r1=482786&r2=482787
==============================================================================
--- incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
(original)
+++ incubator/servicemix/trunk/deployables/serviceengines/servicemix-jsr181/src/test/java/org/apache/servicemix/jsr181/Jsr181ComplexPojoTest.java
Tue Dec  5 13:24:46 2006
@@ -145,8 +145,9 @@
         DefaultServiceMixClient client = new DefaultServiceMixClient(container);
         InOut me = client.createInOutExchange();
         me.setInterfaceName(new QName("http://jsr181.servicemix.apache.org", "ComplexPojoPortType"));
-        me.getInMessage().setContent(new StringSource("<twoWay xmlns='http://jsr181.servicemix.apache.org'><in0>world</in0></twoWay>"));
+        me.getInMessage().setContent(new StringSource("<twoWay xmlns='http://jsr181.servicemix.apache.org'><in0>world
√£</in0></twoWay>"));
         client.sendSync(me);
+        System.err.println(new SourceTransformer().contentToString(me.getOutMessage()));
         client.done(me);
         
         // Wait all acks being processed



Mime
View raw message