From 25e13c8d1138bb4a9509e359eee3ce1c26becc27 Mon Sep 17 00:00:00 2001 From: cantor Date: Tue, 20 Nov 2007 22:57:31 +0000 Subject: [PATCH] Add linefeeds to log, add logging of additional inbound messages. git-svn-id: https://svn.middleware.georgetown.edu/cpp-opensaml2/trunk@350 fb386ef7-a10c-0410-8ebf-fd3f8e989ab0 --- saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp | 2 +- saml/saml1/binding/impl/SAML1POSTEncoder.cpp | 2 +- saml/saml1/binding/impl/SAML1SOAPDecoder.cpp | 1 + saml/saml1/binding/impl/SAML1SOAPEncoder.cpp | 4 ++-- saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp | 2 +- saml/saml2/binding/impl/SAML2ECPDecoder.cpp | 1 + saml/saml2/binding/impl/SAML2ECPEncoder.cpp | 2 +- saml/saml2/binding/impl/SAML2POSTEncoder.cpp | 2 +- saml/saml2/binding/impl/SAML2RedirectEncoder.cpp | 2 +- saml/saml2/binding/impl/SAML2SOAPDecoder.cpp | 1 + saml/saml2/binding/impl/SAML2SOAPEncoder.cpp | 4 ++-- 11 files changed, 13 insertions(+), 10 deletions(-) diff --git a/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp b/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp index 672aeeb..f8797b8 100644 --- a/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1ArtifactEncoder.cpp @@ -112,7 +112,7 @@ long SAML1ArtifactEncoder::encode( throw BindingException("SAML 1.x Artifact Encoder requires an ArtifactGenerator instance."); if (log.isDebugEnabled()) - log.debugStream() << "marshalled assertion: " << *xmlObject << logging::eol; + log.debugStream() << "marshalled assertion:" << logging::eol << *xmlObject << logging::eol; auto_ptr_char recipientID(recipient ? recipient->getEntityID() : NULL); log.debug("obtaining new artifact for relying party (%s)", recipientID.get() ? recipientID.get() : "unknown"); diff --git a/saml/saml1/binding/impl/SAML1POSTEncoder.cpp b/saml/saml1/binding/impl/SAML1POSTEncoder.cpp index df0ee43..f7c8ecd 100644 --- a/saml/saml1/binding/impl/SAML1POSTEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1POSTEncoder.cpp @@ -150,7 +150,7 @@ long SAML1POSTEncoder::encode( TemplateEngine::TemplateParameters pmap; string& xmlbuf = pmap.m_map["SAMLResponse"]; XMLHelper::serialize(rootElement, xmlbuf); - log.debug("marshalled response: %s", xmlbuf.c_str()); + log.debug("marshalled response:\n%s", xmlbuf.c_str()); // Replace with base-64 encoded version. unsigned int len=0; diff --git a/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp b/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp index 971d700..d60dced 100644 --- a/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp +++ b/saml/saml1/binding/impl/SAML1SOAPDecoder.cpp @@ -84,6 +84,7 @@ XMLObject* SAML1SOAPDecoder::decode( const char* data = genericRequest.getRequestBody(); if (!data) throw BindingException("SOAP message had an empty request body."); + log.debug("received message:\n%s", data); istringstream is(data); // Parse and bind the document into an XMLObject. diff --git a/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp b/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp index bb9f984..f20e49d 100644 --- a/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp +++ b/saml/saml1/binding/impl/SAML1SOAPEncoder.cpp @@ -158,7 +158,7 @@ long SAML1SOAPEncoder::encode( s << *rootElement; if (log.isDebugEnabled()) - log.debug("marshalled envelope: %s", s.str().c_str()); + log.debug("marshalled envelope:\n%s", s.str().c_str()); log.debug("sending serialized envelope"); bool error = (!response && env->getBody() && env->getBody()->hasChildren() && @@ -196,7 +196,7 @@ long SAML1SOAPEncoder::encode( s << *rootElement; if (log.isDebugEnabled()) - log.debug("marshalled envelope: %s", s.str().c_str()); + log.debug("marshalled envelope:\n%s", s.str().c_str()); log.debug("sending serialized envelope"); long ret = genericResponse.sendError(s); diff --git a/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp b/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp index e4a9cd3..f0f590c 100644 --- a/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2ArtifactEncoder.cpp @@ -164,7 +164,7 @@ long SAML2ArtifactEncoder::encode( } if (log.isDebugEnabled()) - log.debugStream() << "marshalled message: " << *xmlObject << logging::eol; + log.debugStream() << "marshalled message:" << logging::eol << *xmlObject << logging::eol; // Store the message. Last step in storage will be to delete the XML. log.debug("storing artifact and content in map"); diff --git a/saml/saml2/binding/impl/SAML2ECPDecoder.cpp b/saml/saml2/binding/impl/SAML2ECPDecoder.cpp index e867a5a..d311286 100644 --- a/saml/saml2/binding/impl/SAML2ECPDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2ECPDecoder.cpp @@ -85,6 +85,7 @@ XMLObject* SAML2ECPDecoder::decode( const char* data = genericRequest.getRequestBody(); if (!data) throw BindingException("PAOS message had an empty request body."); + log.debug("received message:\n%s", data); istringstream is(data); // Parse and bind the document into an XMLObject. diff --git a/saml/saml2/binding/impl/SAML2ECPEncoder.cpp b/saml/saml2/binding/impl/SAML2ECPEncoder.cpp index 7a1f1ad..2cddf29 100644 --- a/saml/saml2/binding/impl/SAML2ECPEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2ECPEncoder.cpp @@ -225,7 +225,7 @@ long SAML2ECPEncoder::encode( s << *rootElement; if (log.isDebugEnabled()) - log.debug("marshalled envelope: %s", s.str().c_str()); + log.debug("marshalled envelope:\n%s", s.str().c_str()); log.debug("sending serialized envelope"); long ret = genericResponse.sendResponse(s); diff --git a/saml/saml2/binding/impl/SAML2POSTEncoder.cpp b/saml/saml2/binding/impl/SAML2POSTEncoder.cpp index bc651c2..3b303fc 100644 --- a/saml/saml2/binding/impl/SAML2POSTEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2POSTEncoder.cpp @@ -158,7 +158,7 @@ long SAML2POSTEncoder::encode( TemplateEngine::TemplateParameters pmap; string& msg = pmap.m_map[(request ? "SAMLRequest" : "SAMLResponse")]; XMLHelper::serialize(rootElement, msg); - log.debug("marshalled message: %s", msg.c_str()); + log.debug("marshalled message:\n%s", msg.c_str()); // SimpleSign. if (credential && m_simple) { diff --git a/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp b/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp index ac711f1..e4222fa 100644 --- a/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2RedirectEncoder.cpp @@ -116,7 +116,7 @@ long SAML2RedirectEncoder::encode( DOMElement* rootElement = xmlObject->marshall(); string xmlbuf; XMLHelper::serialize(rootElement, xmlbuf); - log.debug("marshalled message: %s", xmlbuf.c_str()); + log.debug("marshalled message:\n%s", xmlbuf.c_str()); unsigned int len; char* deflated = deflate(const_cast(xmlbuf.c_str()), xmlbuf.length(), &len); diff --git a/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp b/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp index 8325d33..e006a9e 100644 --- a/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp +++ b/saml/saml2/binding/impl/SAML2SOAPDecoder.cpp @@ -84,6 +84,7 @@ XMLObject* SAML2SOAPDecoder::decode( const char* data = genericRequest.getRequestBody(); if (!data) throw BindingException("SOAP message had an empty request body."); + log.debug("received message:\n%s", data); istringstream is(data); // Parse and bind the document into an XMLObject. diff --git a/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp b/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp index 98f5e9b..3efb12b 100644 --- a/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp +++ b/saml/saml2/binding/impl/SAML2SOAPEncoder.cpp @@ -156,7 +156,7 @@ long SAML2SOAPEncoder::encode( s << *rootElement; if (log.isDebugEnabled()) - log.debug("marshalled envelope: %s", s.str().c_str()); + log.debug("marshalled envelope:\n%s", s.str().c_str()); log.debug("sending serialized envelope"); bool error = (!msg && env->getBody() && env->getBody()->hasChildren() && @@ -194,7 +194,7 @@ long SAML2SOAPEncoder::encode( s << *rootElement; if (log.isDebugEnabled()) - log.debug("marshalled envelope: %s", s.str().c_str()); + log.debug("marshalled envelope:\n%s", s.str().c_str()); log.debug("sending serialized envelope"); long ret = genericResponse.sendError(s); -- 2.1.4