First SOAP encoder.
[shibboleth/cpp-opensaml.git] / saml / saml1 / binding / impl / SAML1POSTEncoder.cpp
index ce99ce1..5c15044 100644 (file)
@@ -22,7 +22,6 @@
 
 #include "internal.h"
 #include "exceptions.h"
-#include "binding/HTTPResponse.h"
 #include "saml1/binding/SAML1POSTEncoder.h"
 #include "saml1/core/Protocols.h"
 
@@ -62,8 +61,6 @@ SAML1POSTEncoder::SAML1POSTEncoder(const DOMElement* e)
         throw XMLToolingException("SAML1POSTEncoder requires template attribute.");
 }
 
-SAML1POSTEncoder::~SAML1POSTEncoder() {}
-
 long SAML1POSTEncoder::encode(
     GenericResponse& genericResponse,
     XMLObject* xmlObject,
@@ -80,9 +77,6 @@ long SAML1POSTEncoder::encode(
     Category& log = Category::getInstance(SAML_LOGCAT".MessageEncoder.SAML1POST");
 
     log.debug("validating input");
-    HTTPResponse* httpResponse=dynamic_cast<HTTPResponse*>(&genericResponse);
-    if (!httpResponse)
-        throw BindingException("Unable to cast response interface to HTTPResponse type.");
     if (xmlObject->getParent())
         throw BindingException("Cannot encode XML content with parent.");
     Response* response = dynamic_cast<Response*>(xmlObject);
@@ -141,8 +135,8 @@ long SAML1POSTEncoder::encode(
     params["TARGET"] = relayState;
     stringstream s;
     engine->run(infile, s, params);
-    httpResponse->setContentType("text/html");
-    long ret = httpResponse->sendResponse(s, HTTPResponse::SAML_HTTP_STATUS_OK);
+    genericResponse.setContentType("text/html");
+    long ret = genericResponse.sendResponse(s);
 
     // Cleanup by destroying XML.
     delete xmlObject;