cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r1399985 - in /cxf/branches/2.6.x-fixes: ./ rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Date Fri, 19 Oct 2012 07:11:40 GMT
Author: ffang
Date: Fri Oct 19 07:11:39 2012
New Revision: 1399985

URL: http://svn.apache.org/viewvc?rev=1399985&view=rev
Log:
Merged revisions 1399983 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1399983 | ffang | 2012-10-19 15:02:16 +0800 (δΊ”, 19 10 2012) | 1 line
  
  [CXF-4584]org.w3c.dom.DOMException when sending soap11 request and returning soap12 response

........

Modified:
    cxf/branches/2.6.x-fixes/   (props changed)
    cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:1399983

Propchange: cxf/branches/2.6.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java?rev=1399985&r1=1399984&r2=1399985&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/MessageModeOutInterceptor.java
Fri Oct 19 07:11:39 2012
@@ -28,6 +28,7 @@ import javax.activation.DataSource;
 import javax.xml.namespace.QName;
 import javax.xml.soap.MessageFactory;
 import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPHeader;
 import javax.xml.soap.SOAPMessage;
 import javax.xml.soap.SOAPPart;
 import javax.xml.stream.XMLStreamException;
@@ -38,6 +39,7 @@ import org.w3c.dom.DocumentFragment;
 import org.w3c.dom.Node;
 
 import org.apache.cxf.attachment.AttachmentDeserializer;
+import org.apache.cxf.binding.soap.Soap12;
 import org.apache.cxf.binding.soap.SoapFault;
 import org.apache.cxf.binding.soap.SoapMessage;
 import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
@@ -162,6 +164,22 @@ public class MessageModeOutInterceptor e
                 message.put("write.attachments", Boolean.TRUE);
             }
             try {
+                if (message instanceof org.apache.cxf.binding.soap.SoapMessage) {
+                    org.apache.cxf.binding.soap.SoapMessage cxfSoapMessage = 
+                            (org.apache.cxf.binding.soap.SoapMessage)message;
+                    String cxfNamespace = cxfSoapMessage.getVersion().getNamespace();
+                    SOAPHeader soapHeader = soapMessage.getSOAPHeader();
+                    String namespace = soapHeader == null ? null : soapHeader.getNamespaceURI();
+                    if (namespace != null && cxfNamespace != null && !namespace.equals(cxfNamespace)

+                            && Soap12.SOAP_NAMESPACE.equals(namespace)) {
+                        cxfSoapMessage.setVersion(Soap12.getInstance());
+                        cxfSoapMessage.put(Message.CONTENT_TYPE, cxfSoapMessage.getVersion().getContentType());
+                    }
+                }
+            } catch (SOAPException e) {
+                //ignore
+            }
+            try {
                 Object enc = soapMessage.getProperty(SOAPMessage.CHARACTER_SET_ENCODING);
                 if (enc instanceof String) {
                     message.put(Message.ENCODING, enc);



Mime
View raw message