/**
* SAML2POSTEncoder.cpp
*
- * SAML 2.0 HTTP-POST binding message encoder
+ * SAML 2.0 HTTP-POST binding message encoder.
*/
#include "internal.h"
#include <xmltooling/XMLToolingConfig.h>
#include <xmltooling/io/HTTPResponse.h>
#include <xmltooling/security/Credential.h>
+#include <xmltooling/signature/KeyInfo.h>
+#include <xmltooling/signature/Signature.h>
#include <xmltooling/util/NDC.h>
#include <xmltooling/util/PathResolver.h>
#include <xmltooling/util/TemplateEngine.h>
xmltooling::NDC ndc("encode");
#endif
Category& log = Category::getInstance(SAML_LOGCAT".MessageEncoder.SAML2POST");
+ log.debug("validating input");
TemplateEngine* engine = XMLToolingConfig::getConfig().getTemplateEngine();
- if (!engine)
- throw BindingException("Encoding message using POST requires a TemplateEngine instance.");
-
- log.debug("validating input");
+ if (!engine || !destination)
+ throw BindingException("Encoding message using POST requires a TemplateEngine instance and a destination.");
+ HTTPResponse::sanitizeURL(destination);
if (xmlObject->getParent())
throw BindingException("Cannot encode XML content with parent.");