ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1196556 - in /webservices/wss4j/trunk/src/main/java/org/apache/ws/security: message/token/SecurityTokenReference.java transform/STRTransform.java
Date Wed, 02 Nov 2011 12:23:50 GMT
Author: coheigea
Date: Wed Nov  2 12:23:50 2011
New Revision: 1196556

URL: http://svn.apache.org/viewvc?rev=1196556&view=rev
Log:
Make WSDocInfo optional in the STRTransform.
 - Not every scenario will work if no WSDocInfo object is available

Modified:
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
    webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransform.java

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java?rev=1196556&r1=1196555&r2=1196556&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
(original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/message/token/SecurityTokenReference.java
Wed Nov  2 12:23:50 2011
@@ -268,7 +268,10 @@ public class SecurityTokenReference {
         //
         // Delegate finding the element to the CallbackLookup instance
         //
-        CallbackLookup callbackLookup = docInfo.getCallbackLookup();
+        CallbackLookup callbackLookup = null;
+        if (docInfo != null) {
+            callbackLookup = docInfo.getCallbackLookup();
+        }
         if (callbackLookup == null) {
             callbackLookup = new DOMCallbackLookup(doc);
         }
@@ -602,9 +605,6 @@ public class SecurityTokenReference {
 
     /**
      * Gets the certificate identified with X509 issuerSerial data.
-     * This method first tries to get the embedded certificate.
-     * If this fails it checks if the certificate is  in the
-     * keystore.
      *
      * @return a certificate array or null if nothing found
      */

Modified: webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransform.java
URL: http://svn.apache.org/viewvc/webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransform.java?rev=1196556&r1=1196555&r2=1196556&view=diff
==============================================================================
--- webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransform.java
(original)
+++ webservices/wss4j/trunk/src/main/java/org/apache/ws/security/transform/STRTransform.java
Wed Nov  2 12:23:50 2011
@@ -181,9 +181,13 @@ public class STRTransform extends Transf
             //
             // Third and fourth step are performed by dereferenceSTR()
             //
-            WSDocInfo wsDocInfo = (WSDocInfo)xc.getProperty(TRANSFORM_WS_DOC_INFO);
-            if (wsDocInfo == null) {
-                throw new TransformException("no WSDocInfo found");
+            Object wsDocInfoObject = xc.getProperty(TRANSFORM_WS_DOC_INFO);
+            WSDocInfo wsDocInfo = null;
+            if (wsDocInfoObject instanceof WSDocInfo) {
+                wsDocInfo = (WSDocInfo)wsDocInfoObject;
+            }
+            if (wsDocInfo == null && doDebug) {
+                log.debug("STRTransform: no WSDocInfo found");
             }
 
             Document doc = str.getOwnerDocument();



Mime
View raw message