Streamline SecurityPolicy methods and rule modification.
[shibboleth/opensaml2.git] / saml / saml2 / binding / impl / SAML2SOAPDecoder.cpp
index 2d9d22f..8879499 100644 (file)
@@ -25,7 +25,7 @@
 #include "binding/MessageDecoder.h"
 #include "saml2/core/Protocols.h"
 
-#include <log4cpp/Category.hh>
+#include <xmltooling/logging.h>
 #include <xmltooling/soap/SOAP.h>
 #include <xmltooling/util/NDC.h>
 #include <xmltooling/validation/ValidatorSuite.h>
@@ -33,8 +33,8 @@
 using namespace opensaml::saml2p;
 using namespace opensaml;
 using namespace soap11;
+using namespace xmltooling::logging;
 using namespace xmltooling;
-using namespace log4cpp;
 using namespace std;
 
 namespace opensaml {
@@ -42,7 +42,7 @@ namespace opensaml {
         class SAML_DLLLOCAL SAML2SOAPDecoder : public MessageDecoder
         {
         public:
-            SAML2SOAPDecoder(const DOMElement* e);
+            SAML2SOAPDecoder() {}
             virtual ~SAML2SOAPDecoder() {}
 
             bool isUserAgentPresent() const {
@@ -56,15 +56,13 @@ namespace opensaml {
                 ) const;
         };                
 
-        MessageDecoder* SAML_DLLLOCAL SAML2SOAPDecoderFactory(const DOMElement* const & e)
+        MessageDecoder* SAML_DLLLOCAL SAML2SOAPDecoderFactory(const pair<const DOMElement*,const XMLCh*>& p)
         {
-            return new SAML2SOAPDecoder(e);
+            return new SAML2SOAPDecoder();
         }
     };
 };
 
-SAML2SOAPDecoder::SAML2SOAPDecoder(const DOMElement* e) {}
-
 XMLObject* SAML2SOAPDecoder::decode(
     string& relayState,
     const GenericRequest& genericRequest,
@@ -107,8 +105,9 @@ XMLObject* SAML2SOAPDecoder::decode(
         RequestAbstractType* request = dynamic_cast<RequestAbstractType*>(body->getUnknownXMLObjects().front());
         if (request) {
             // Run through the policy at two layers.
-            policy.evaluate(*env, &genericRequest);
-            policy.evaluate(*request, &genericRequest);
+            policy.evaluate(*env, &genericRequest, samlconstants::SAML20P_NS);
+            policy.reset(true);
+            policy.evaluate(*request, &genericRequest, samlconstants::SAML20P_NS);
             xmlObject.release();
             body->detach(); // frees Envelope
             request->detach();   // frees Body