cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1055152 - /cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Date Tue, 04 Jan 2011 19:33:20 GMT
Author: dkulp
Date: Tue Jan  4 19:33:20 2011
New Revision: 1055152

URL: http://svn.apache.org/viewvc?rev=1055152&view=rev
Log:
[CXF-3228] Honor the SAAJ encoding and write decl properties

Modified:
    cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java

Modified: cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java?rev=1055152&r1=1055151&r2=1055152&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
(original)
+++ cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Tue Jan  4 19:33:20 2011
@@ -46,10 +46,12 @@ import org.apache.cxf.binding.soap.saaj.
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.interceptor.AbstractOutDatabindingInterceptor;
 import org.apache.cxf.interceptor.Fault;
+import org.apache.cxf.interceptor.StaxOutInterceptor;
 import org.apache.cxf.io.CachedOutputStream;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageContentsList;
 import org.apache.cxf.message.MessageImpl;
+import org.apache.cxf.message.MessageUtils;
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -156,6 +158,23 @@ public class MessageModeOutInterceptor e
             if (soapMessage.countAttachments() > 0) {
                 message.put("write.attachments", Boolean.TRUE);
             }
+            try {
+                Object enc = soapMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
+                if (enc instanceof String) {
+                    message.put(Message.ENCODING, enc);
+                }
+            } catch (SOAPException e) {
+                //ignore
+            }
+            try {
+                Object xmlDec = soapMessage.getProperty(SOAPMessage.WRITE_XML_DECLARATION);
+                if (xmlDec != null) {
+                    boolean b = MessageUtils.isTrue(xmlDec);
+                    message.put(StaxOutInterceptor.FORCE_START_DOCUMENT, b);
+                }
+            } catch (SOAPException e) {
+                //ignore
+            }
         }
         message.getInterceptorChain().add(internal);
     }



Mime
View raw message