X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=saml%2Fsaml1%2Fbinding%2Fimpl%2FSAML1SOAPDecoder.cpp;h=d60dcedc81a8f7ec195468b2c0b73e1ce0e8d65e;hb=25e13c8d1138bb4a9509e359eee3ce1c26becc27;hp=4d88e7d25001847af826c017bee74485fae30638;hpb=a0323c50525a6ff43795da2dc786e5aeaf726d41;p=shibboleth%2Fopensaml2.git diff --git a/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp b/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp index 4d88e7d..d60dced 100644 --- a/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp @@ -22,7 +22,7 @@ #include "internal.h" #include "exceptions.h" -#include "binding/MessageDecoder.h" +#include "saml1/binding/SAML1MessageDecoder.h" #include "saml1/core/Protocols.h" #include @@ -39,7 +39,7 @@ using namespace std; namespace opensaml { namespace saml1p { - class SAML_DLLLOCAL SAML1SOAPDecoder : public MessageDecoder + class SAML_DLLLOCAL SAML1SOAPDecoder : public SAML1MessageDecoder { public: SAML1SOAPDecoder() {} @@ -84,6 +84,7 @@ XMLObject* SAML1SOAPDecoder::decode( const char* data = genericRequest.getRequestBody(); if (!data) throw BindingException("SOAP message had an empty request body."); + log.debug("received message:\n%s", data); istringstream is(data); // Parse and bind the document into an XMLObject. @@ -106,17 +107,23 @@ XMLObject* SAML1SOAPDecoder::decode( if (request) { // Run through the policy at two layers. pair minor = request->getMinorVersion(); - policy.evaluate( + extractMessageDetails( *env, - &genericRequest, - (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM + genericRequest, + (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM, + policy ); + policy.evaluate(*env,&genericRequest); + + // Reset, extract, and run again. policy.reset(true); - policy.evaluate( + extractMessageDetails( *request, - &genericRequest, - (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM + genericRequest, + (minor.first && minor.second==0) ? samlconstants::SAML10_PROTOCOL_ENUM : samlconstants::SAML11_PROTOCOL_ENUM, + policy ); + policy.evaluate(*request,&genericRequest); xmlObject.release(); body->detach(); // frees Envelope request->detach(); // frees Body