Correct constness of transport API, update version.
[shibboleth/cpp-opensaml.git] / saml / binding / SOAPClient.h
index 1c40cdc..e26be48 100644 (file)
@@ -31,15 +31,17 @@ namespace opensaml {
     /**
      * 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() {}
 
@@ -62,7 +64,7 @@ namespace opensaml {
          * @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.
@@ -70,6 +72,17 @@ namespace opensaml {
          * @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:
         /**
@@ -78,7 +91,7 @@ namespace opensaml {
          * 
          * @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;
@@ -86,7 +99,7 @@ namespace opensaml {
         /** Flag controlling whether transport/peer authn is mandatory. */
         bool m_force;
     
-    private:
+        /** Metadata-based peer identity. */        
         const saml2md::RoleDescriptor* m_peer;
     };