/*
- * Copyright 2001-2006 Internet2
+ * Copyright 2001-2007 Internet2
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/**
* Specialized SOAPClient for SAML SOAP bindings.
*/
- class SAML_API SOAPClient : soap11::SOAPClient
+ class SAML_API SOAPClient : public soap11::SOAPClient
{
public:
/**
* Creates a SOAP client instance with a particular SecurityPolicy.
*
- * @param policy reference to SecurityPolicy to apply
+ * @param policy reference to SecurityPolicy to apply
+ * @param validating controls schema validation
*/
- SOAPClient(SecurityPolicy& policy) : m_policy(policy), m_force(true) {}
+ SOAPClient(SecurityPolicy& policy, bool validating=false)
+ : soap11::SOAPClient(validating), m_policy(policy), m_force(true), m_peer(NULL) {}
virtual ~SOAPClient() {}
* @param peer peer to send message to, expressed in TrustEngine terms
* @param endpoint URL of endpoint to recieve message
*/
- void send(const soap11::Envelope* env, const xmltooling::KeyInfoSource& peer, const char* endpoint);
+ void send(const soap11::Envelope& env, const xmltooling::KeyInfoSource& peer, const char* endpoint);
/**
* Override applies SecurityPolicy to envelope before returning it.
* @return response envelope after SecurityPolicy has been applied
*/
soap11::Envelope* receive();
+
+ void reset();
+
+ /**
+ * Returns the SecurityPolicy supplied to the client.
+ *
+ * @return the associated SecurityPolicy
+ */
+ SecurityPolicy& getPolicy() const {
+ return m_policy;
+ }
protected:
/**
*
* @param transport reference to transport layer
*/
- void prepareTransport(const xmltooling::SOAPTransport& transport);
+ void prepareTransport(xmltooling::SOAPTransport& transport);
/** Reference to security policy to apply. */
SecurityPolicy& m_policy;
/** Flag controlling whether transport/peer authn is mandatory. */
bool m_force;
- private:
+ /** Metadata-based peer identity. */
const saml2md::RoleDescriptor* m_peer;
};