Major revamp of credential and trust handling code, PKIX engine still needs work.
[shibboleth/cpp-xmltooling.git] / xmltooling / soap / SOAPClient.h
index b19b7d4..6e27d40 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  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.
 #ifndef __xmltooling_soap11client_h__
 #define __xmltooling_soap11client_h__
 
-#include <xmltooling/security/KeyInfoSource.h>
+#include <xmltooling/security/CredentialResolver.h>
 #include <xmltooling/soap/SOAPTransport.h>
 
 namespace soap11 {
 
     class XMLTOOL_API Envelope;
+    class XMLTOOL_API Fault;
 
     /**
      * Implements SOAP 1.1 messaging over a transport.
@@ -40,7 +41,13 @@ namespace soap11 {
     {
         MAKE_NONCOPYABLE(SOAPClient);
     public:
+        /**
+         * Constructor
+         * 
+         * @param validate  true iff schema validation should be used 
+         */
         SOAPClient(bool validate=false) : m_validate(validate), m_transport(NULL) {}
+        
         virtual ~SOAPClient();
         
         /**
@@ -61,11 +68,15 @@ namespace soap11 {
          * appropriate for the endpoint URL provided and supply it to the
          * prepareTransport() method below.
          * 
-         * @param env       SOAP envelope to send
-         * @param peer      peer to send message to, expressed in TrustEngine terms
-         * @param endpoint  URL of endpoint to recieve message
+         * <p>To authenticate the server end, the transport layer object
+         * exposes a method to load a TrustEngine and CredentialResolver
+         * in a subclass-specific version of the prepareTransport() method.   
+         * 
+         * @param env           SOAP envelope to send
+         * @param peerName      name of peer
+         * @param endpoint      URL of endpoint to recieve message
          */
-        virtual void send(const Envelope* env, const xmltooling::KeyInfoSource& peer, const char* endpoint);
+        virtual void send(const Envelope& env, const char* peerName, const char* endpoint);
         
         /**
          * Returns the response message, if any. As long as a response is
@@ -73,8 +84,6 @@ namespace soap11 {
          * will be forthcoming, an exception is raised.
          * 
          * <p>The caller is responsible for freeing the returned envelope.
-         * 
-         * <p>Once a response is returned, the object will be reset for a subsequent call.
          */
         virtual Envelope* receive();
         
@@ -89,8 +98,16 @@ namespace soap11 {
          * 
          * @param transport reference to transport layer
          */
-        virtual void prepareTransport(const xmltooling::SOAPTransport& transport) {}
-        
+        virtual void prepareTransport(xmltooling::SOAPTransport& transport) {}
+
+        /**
+         * Handling of SOAP faults.
+         * 
+         * @param fault SOAP Fault received by client
+         * @return true iff the Fault should be treated as a fatal error
+         */
+        virtual bool handleFault(const soap11::Fault& fault);
+            
         /** Flag controlling schema validation. */
         bool m_validate;