Improve logging around XML processing of content.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Sat, 19 Jun 2010 19:35:34 +0000 (19:35 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Sat, 19 Jun 2010 19:35:34 +0000 (19:35 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/branches/REL_2@3262 cb58f699-b61c-0410-a6fe-9272a202ed29

shibsp/attribute/NameIDAttributeDecoder.cpp

index 6b03fae..f9ff33f 100644 (file)
@@ -117,23 +117,35 @@ shibsp::Attribute* NameIDAttributeDecoder::decode(
 
         for (; v!=stop; ++v) {
             const NameIDType* n2 = dynamic_cast<const NameIDType*>(*v);
-            if (n2)
+            if (n2) {
+                log.debug("decoding AttributeValue element of saml2:NameIDType type");
                 extract(n2, dest, assertingParty, relyingParty);
+            }
             else {
                 const NameIdentifier* n1=dynamic_cast<const NameIdentifier*>(*v);
-                if (n1)
+                if (n1) {
+                    log.debug("decoding AttributeValue element of saml1:NameIdentifier type");
                     extract(n1, dest, assertingParty, relyingParty);
+                }
                 else if ((*v)->hasChildren()) {
                     const list<XMLObject*>& values = (*v)->getOrderedChildren();
                     for (list<XMLObject*>::const_iterator vv = values.begin(); vv!=values.end(); ++vv) {
-                        if (n2=dynamic_cast<const NameIDType*>(*vv))
+                        if (n2=dynamic_cast<const NameIDType*>(*vv)) {
+                            log.debug("decoding saml2:NameID child element of AttributeValue");
                             extract(n2, dest, assertingParty, relyingParty);
-                        else if (n1=dynamic_cast<const NameIdentifier*>(*vv))
+                        }
+                        else if (n1=dynamic_cast<const NameIdentifier*>(*vv)) {
+                            log.debug("decoding saml1:NameIdentifier child element of AttributeValue");
                             extract(n1, dest, assertingParty, relyingParty);
-                        else
-                            log.warn("skipping AttributeValue without a recognizable NameID/NameIdentifier");
+                        }
+                        else {
+                            log.warn("skipping AttributeValue child element not recognizable as NameID/NameIdentifier");
+                        }
                     }
                 }
+                else {
+                    log.warn("AttributeValue was not of a supported type and contains no child elements");
+                }
             }
         }