Refactor message extraction into decoders and clients.
[shibboleth/opensaml2.git] / saml / saml2 / binding / impl / SAML2RedirectDecoder.cpp
index a5e599d..b43589c 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "internal.h"
 #include "exceptions.h"
-#include "binding/MessageDecoder.h"
+#include "saml2/binding/SAML2MessageDecoder.h"
 #include "saml2/binding/SAML2Redirect.h"
 #include "saml2/core/Protocols.h"
 #include "saml2/metadata/Metadata.h"
@@ -45,7 +45,7 @@ using namespace std;
 
 namespace opensaml {
     namespace saml2p {              
-        class SAML_DLLLOCAL SAML2RedirectDecoder : public MessageDecoder
+        class SAML_DLLLOCAL SAML2RedirectDecoder : public SAML2MessageDecoder
         {
         public:
             SAML2RedirectDecoder() {}
@@ -135,10 +135,11 @@ XMLObject* SAML2RedirectDecoder::decode(
     }
     
     if (!policy.getValidating())
-        SchemaValidators.validate(xmlObject.get());
+        SchemaValidators.validate(root);
     
     // Run through the policy.
-    policy.evaluate(*root, &genericRequest, samlconstants::SAML20P_NS);
+    extractMessageDetails(*root, genericRequest, samlconstants::SAML20P_NS, policy);
+    policy.evaluate(*root, &genericRequest);
 
     // Check destination URL.
     auto_ptr_char dest(request ? request->getDestination() : response->getDestination());