cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r755835 - in /cxf/trunk/rt: bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
Date Thu, 19 Mar 2009 04:55:59 GMT
Author: dkulp
Date: Thu Mar 19 04:55:59 2009
New Revision: 755835

URL: http://svn.apache.org/viewvc?rev=755835&view=rev
Log:
Use stax to setup saaj
check to see if parts are there to sign

Modified:
    cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java

Modified: cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=755835&r1=755834&r2=755835&view=diff
==============================================================================
--- cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
(original)
+++ cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
Thu Mar 19 04:55:59 2009
@@ -58,6 +58,7 @@
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.staxutils.StaxUtils;
+import org.apache.cxf.staxutils.W3CDOMStreamWriter;
 
 /**
  * Builds a SAAJ tree from the Document fragment inside the message which contains
@@ -88,8 +89,8 @@
             SOAPPart part = soapMessage.getSOAPPart();
             
             Document node = (Document) message.getContent(Node.class);
-            DOMSource source = new DOMSource(node);
-            part.setContent(source);
+            StaxUtils.copy(node, new W3CDOMStreamWriter(part));
+
             
             // TODO: setup mime headers
             Collection<Attachment> atts = message.getAttachments();

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java?rev=755835&r1=755834&r2=755835&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/SymmetricBindingHandler.java
Thu Mar 19 04:55:59 2009
@@ -324,13 +324,17 @@
 
             if (isRequestor()) {
                 addSupportingTokens(sigs);
-                signatures.add(doSignature(sigs, sigTokenWrapper, sigToken, sigTok, tokIncluded));
+                if (!sigs.isEmpty()) {
+                    signatures.add(doSignature(sigs, sigTokenWrapper, sigToken, sigTok, tokIncluded));
+                }
                 doEndorse();
             } else {
                 //confirm sig
                 assertSupportingTokens(sigs);
                 addSignatureConfirmation(sigs);
-                doSignature(sigs, sigTokenWrapper, sigToken, sigTok, tokIncluded);
+                if (!sigs.isEmpty()) {
+                    doSignature(sigs, sigTokenWrapper, sigToken, sigTok, tokIncluded);
+                }
             }
 
             



Mime
View raw message