Add "sender" to SOAP APIs to avoid reuse of connections across apps.
[shibboleth/cpp-opensaml.git] / saml / saml2 / binding / impl / SAML2SOAPClient.cpp
index af55891..626b607 100644 (file)
@@ -37,13 +37,13 @@ using namespace xmltooling::logging;
 using namespace xmltooling;
 using namespace std;
 
-void SAML2SOAPClient::sendSAML(RequestAbstractType* request, MetadataCredentialCriteria& peer, const char* endpoint)
+void SAML2SOAPClient::sendSAML(RequestAbstractType* request, const char* from, MetadataCredentialCriteria& to, const char* endpoint)
 {
     auto_ptr<Envelope> env(EnvelopeBuilder::buildEnvelope());
     Body* body = BodyBuilder::buildBody();
     env->setBody(body);
     body->getUnknownXMLObjects().push_back(request);
-    m_soaper.send(*env.get(), peer, endpoint);
+    m_soaper.send(*env.get(), from, to, endpoint);
     m_correlate = XMLString::replicate(request->getID());
 }
 
@@ -61,7 +61,8 @@ StatusResponseType* SAML2SOAPClient::receiveSAML()
                 if (m_correlate && response->getInResponseTo() && !XMLString::equals(m_correlate, response->getInResponseTo()))
                     throw SecurityPolicyException("InResponseTo attribute did not correlate with the Request ID.");
 
-                m_soaper.getPolicy().evaluate(*response);
+                m_soaper.getPolicy().reset(true);
+                m_soaper.getPolicy().evaluate(*response, NULL, samlconstants::SAML20P_NS);
                 if (!m_soaper.getPolicy().isSecure()) {
                     SecurityPolicyException ex("Security policy could not authenticate the message.");
                     annotateException(&ex, m_soaper.getPolicy().getIssuerMetadata(), response->getStatus());   // throws it