Merged issuer/protocol extraction back into rules.
[shibboleth/cpp-opensaml.git] / saml / binding / MessageEncoder.h
index 668049a..9e611ff 100644 (file)
 #ifndef __saml_encoder_h__
 #define __saml_encoder_h__
 
-#include <saml/base.h>
+#include <saml/binding/GenericResponse.h>
 
-#include <map>
-#include <string>
+#include <istream>
 #include <xmltooling/XMLObject.h>
 #include <xmltooling/signature/CredentialResolver.h>
 
@@ -92,7 +91,7 @@ namespace opensaml {
         }
         
         /**
-         * Encodes an XML object/message into a set of binding-specific data "fields".
+         * Encodes an XML object/message into a binding- and transport-specific response.
          * The XML content cannot have a parent object, and any existing references to
          * the content will be invalidated if the encode method returns successfully.
          * 
@@ -100,27 +99,21 @@ namespace opensaml {
          * binding-specific manner. The CredentialResolver <strong>MUST</strong>
          * be locked by the caller. 
          * 
-         * <p>An embedded URLEncoder instance may be required by some bindings
-         * in order to produce predictable signature input.
-         * 
          * <p>Artifact-based bindings require an ArtifactGenerator be set to
          * produce an artifact suitable for the intended recipient.
          * 
-         * <p>Note that the name/value pairs resulting from the encoding operation are
-         * <strong>NOT</strong> URL-encoded or otherwise transformed. It is the caller's
-         * responsibility to apply any necessary encoding when preparing the data for
-         * transport.
-         * 
-         * @param outputFields      name/value pairs containing the results of encoding the message
-         * @param xmlObject         XML object/message to encode
+         * @param genericResponse   reference to interface for sending transport response      
+         * @param xmlObject         XML message to encode
+         * @param destination       destination URL for message
          * @param recipientID       optional entityID of message recipient
          * @param relayState        optional RelayState value to accompany message
          * @param credResolver      optional CredentialResolver instance to supply signing material
          * @param sigAlgorithm      optional signature algorithm identifier
          */
-        virtual void encode(
-            std::map<std::string,std::string>& outputFields,
+        virtual long encode(
+            GenericResponse& genericResponse,
             xmltooling::XMLObject* xmlObject,
+            const char* destination,
             const char* recipientID=NULL,
             const char* relayState=NULL,
             const xmlsignature::CredentialResolver* credResolver=NULL,
@@ -151,21 +144,6 @@ namespace opensaml {
      * Registers MessageEncoder plugins into the runtime.
      */
     void SAML_API registerMessageEncoders();
-
-    /** MessageEncoder for SAML 1.x Browser/Artifact "binding" (really part of profile) */
-    #define SAML1_ARTIFACT_ENCODER  "urn:oasis:names:tc:SAML:1.0:profiles:artifact-01"
-
-    /** MessageEncoder for SAML 1.x Browser/POST "binding" (really part of profile) */
-    #define SAML1_POST_ENCODER  "urn:oasis:names:tc:SAML:1.0:profiles:browser-post"
-    
-    /** MessageEncoder for SAML 2.0 HTTP-Artifact binding */
-    #define SAML2_ARTIFACT_ENCODER "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Artifact"
-
-    /** MessageEncoder for SAML 2.0 HTTP-POST binding */
-    #define SAML2_POST_ENCODER "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"
-
-    /** MessageEncoder for SAML 2.0 HTTP-Redirect binding */
-    #define SAML2_REDIRECT_ENCODER "urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"
 };
 
 #endif /* __saml_encoder_h__ */