Log outgoing binding in regular process log
authorlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 13 Sep 2007 14:31:41 +0000 (14:31 +0000)
committerlajoie <lajoie@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Thu, 13 Sep 2007 14:31:41 +0000 (14:31 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@2386 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/idp/profile/AbstractSAMLProfileHandler.java

index 6c09293..e9fea02 100644 (file)
@@ -221,18 +221,13 @@ public abstract class AbstractSAMLProfileHandler extends
      * @throws ProfileException thrown if no message encoder is registered for this profiles binding
      */
     protected void encodeResponse(BaseSAMLProfileRequestContext requestContext) throws ProfileException {
-        if (log.isDebugEnabled()) {
-            log.debug("Encoding response to SAML request " + requestContext.getInboundSAMLMessageId()
-                    + " from relying party " + requestContext.getInboundMessageIssuer());
-        }
-
         try {
             Endpoint peerEndpoint = requestContext.getPeerEntityEndpoint();
-            if(peerEndpoint == null){
+            if (peerEndpoint == null) {
                 log.error("No return endpoint available for relying party " + requestContext.getInboundMessageIssuer());
                 throw new ProfileException("No peer endpoint available to which to send SAML response");
             }
-            
+
             SAMLMessageEncoder encoder = getMessageEncoders().get(requestContext.getPeerEntityEndpoint().getBinding());
             if (encoder == null) {
                 log.error("No outbound message encoder configured for binding "
@@ -240,6 +235,13 @@ public abstract class AbstractSAMLProfileHandler extends
                 throw new ProfileException("No outbound message encoder configured for binding "
                         + requestContext.getPeerEntityEndpoint().getBinding());
             }
+
+            if (log.isDebugEnabled()) {
+                log.debug("Encoding response to SAML request " + requestContext.getInboundSAMLMessageId()
+                        + " from relying party " + requestContext.getInboundMessageIssuer() + " with outbound binding "
+                        + encoder.getBindingURI());
+            }
+
             requestContext.setMessageEncoder(encoder);
             encoder.encode(requestContext);
         } catch (MessageEncodingException e) {
@@ -247,7 +249,7 @@ public abstract class AbstractSAMLProfileHandler extends
                     + requestContext.getInboundMessageIssuer(), e);
         }
     }
-    
+
     /**
      * Writes an aduit log entry indicating the successful response to the attribute request.
      *