cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r775158 - /cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Date Fri, 15 May 2009 14:37:43 GMT
Author: dkulp
Date: Fri May 15 14:37:43 2009
New Revision: 775158

URL: http://svn.apache.org/viewvc?rev=775158&view=rev
Log:
Fix STSClient with latest source databinding optimizations

Modified:
    cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java

Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java?rev=775158&r1=775157&r2=775158&view=diff
==============================================================================
--- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
(original)
+++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
Fri May 15 14:37:43 2009
@@ -403,12 +403,20 @@
 
         Object obj[] = client.invoke(boi, new DOMSource(writer.getDocument().getDocumentElement()));
 
-        SecurityToken token = createSecurityToken((Document)((DOMSource)obj[0]).getNode(),
requestorEntropy);
+        SecurityToken token = createSecurityToken(getDocumentElement((DOMSource)obj[0]),
requestorEntropy);
         if (cert != null) {
             token.setX509Certificate(cert, crypto);
         }
         return token;
     }
+    
+    private Element getDocumentElement(DOMSource ds) {
+        Node nd = ds.getNode();
+        if (nd instanceof Document) {
+            nd = ((Document)nd).getDocumentElement();
+        }
+        return (Element)nd;
+    }
 
     public void renewSecurityToken(SecurityToken tok) throws Exception {
         String action = null;
@@ -625,10 +633,9 @@
         }
     }
 
-    private SecurityToken createSecurityToken(Document document, byte[] requestorEntropy)
+    private SecurityToken createSecurityToken(Element el, byte[] requestorEntropy)
         throws WSSecurityException {
 
-        Element el = document.getDocumentElement();
         if ("RequestSecurityTokenResponseCollection".equals(el.getLocalName())) {
             el = DOMUtils.getFirstElement(el);
         }



Mime
View raw message