#include "internal.h"
#include "exceptions.h"
+#include "binding/HTTPResponse.h"
#include "saml1/binding/SAML1POSTEncoder.h"
#include "saml1/core/Protocols.h"
SAML1POSTEncoder::~SAML1POSTEncoder() {}
long SAML1POSTEncoder::encode(
- HTTPResponse& httpResponse,
+ GenericResponse& genericResponse,
XMLObject* xmlObject,
const char* destination,
const char* recipientID,
xmltooling::NDC ndc("encode");
#endif
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);
params["TARGET"] = relayState;
stringstream s;
engine->run(infile, s, params);
- long ret = httpResponse.sendResponse(s);
+ httpResponse->setContentType("text/html");
+ long ret = httpResponse->sendResponse(s, HTTPResponse::SAML_HTTP_STATUS_OK);
// Cleanup by destroying XML.
delete xmlObject;