[java-opensaml COMMIT] in /trunk: opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/EncodeMessage....
noreply at shibboleth.net
noreply at shibboleth.net
Wed Oct 28 21:20:52 EDT 2015
Author: putmanb
Date: Wed Oct 28 21:20:52 2015
New Revision: 4363
URL: http://svn.shibboleth.net/view/java-opensaml?rev=4363&view=rev
Log:
OSJ-136: AddSOAPFault action changes the type of message in the outbound message context
Modified:
trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/EncodeMessage.java
trunk/opensaml-soap-impl/src/main/java/org/opensaml/soap/soap11/profile/impl/AddSOAPFault.java
trunk/opensaml-soap-impl/src/test/java/org/opensaml/soap/soap11/profile/impl/AddSOAPFaultTest.java
Modified: trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/EncodeMessage.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/EncodeMessage.java?rev=4363&r1=4362&r2=4363&view=diff
==============================================================================
--- trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/EncodeMessage.java (original)
+++ trunk/opensaml-profile-impl/src/main/java/org/opensaml/profile/action/impl/EncodeMessage.java Wed Oct 28 21:20:52 2015
@@ -147,8 +147,13 @@
encoder.encode();
- log.debug("{} Outbound message encoded from a message of type {}", getLogPrefix(),
- msgContext.getMessage().getClass().getName());
+ if (msgContext.getMessage() != null) {
+ log.debug("{} Outbound message encoded from a message of type {}", getLogPrefix(),
+ msgContext.getMessage().getClass().getName());
+ } else {
+ log.debug("{} Outbound message was encoded from protocol-specific data "
+ + "rather than MessageContext#getMessage()", getLogPrefix());
+ }
} catch (final MessageEncodingException | ComponentInitializationException | MessageHandlerException e) {
log.error("{} Unable to encode outbound response", getLogPrefix(), e);
Modified: trunk/opensaml-soap-impl/src/main/java/org/opensaml/soap/soap11/profile/impl/AddSOAPFault.java
URL: http://svn.shibboleth.net/view/java-opensaml/trunk/opensaml-soap-impl/src/main/java/org/opensaml/soap/soap11/profile/impl/AddSOAPFault.java?rev=4363&r1=4362&r2=4363&view=diff
==============================================================================
--- trunk/opensaml-soap-impl/src/main/java/org/opensaml/soap/soap11/profile/impl/AddSOAPFault.java (original)
+++ trunk/opensaml-soap-impl/src/main/java/org/opensaml/soap/soap11/profile/impl/AddSOAPFault.java Wed Oct 28 21:20:52 2015
@@ -24,14 +24,6 @@
import javax.annotation.Nullable;
import javax.xml.namespace.QName;
-import org.opensaml.profile.action.AbstractProfileAction;
-import org.opensaml.profile.context.EventContext;
-import org.opensaml.profile.context.ProfileRequestContext;
-import org.opensaml.profile.context.navigate.CurrentOrPreviousEventLookup;
-import org.opensaml.soap.soap11.Fault;
-import org.opensaml.soap.soap11.FaultCode;
-import org.opensaml.soap.soap11.FaultString;
-
import net.shibboleth.utilities.java.support.annotation.constraint.NonnullElements;
import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
import net.shibboleth.utilities.java.support.component.ComponentSupport;
@@ -41,6 +33,14 @@
import org.opensaml.core.xml.XMLObjectBuilder;
import org.opensaml.core.xml.config.XMLObjectProviderRegistrySupport;
import org.opensaml.messaging.context.MessageContext;
+import org.opensaml.profile.action.AbstractProfileAction;
+import org.opensaml.profile.context.EventContext;
+import org.opensaml.profile.context.ProfileRequestContext;
+import org.opensaml.profile.context.navigate.CurrentOrPreviousEventLookup;
+import org.opensaml.soap.messaging.SOAPMessagingSupport;
+import org.opensaml.soap.soap11.Fault;
+import org.opensaml.soap.soap11.FaultCode;
+import org.opensaml.soap.soap11.FaultString;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -49,10 +49,19 @@
import com.google.common.base.Predicates;
/**
- * Action that builds a SOAP 1.1 {@link Fault} object in the outbound message context.
+ * Action that resolves or builds a SOAP 1.1 {@link Fault} object, and stores it in the outbound message context.
*
- * <p>Options allow for the creation of a {@link FaultString} either explicitly,
- * or via lookup strategy.</p>
+ * <p>
+ * An attempt will first be made to resolve a pre-existing fault instance from the {@link ProfileRequestContext}, via
+ * an optionally configured lookup strategy. This is to accommodate SOAP-aware components which may choose to
+ * emit a specific, locally determined fault. The default strategy is {@link MessageContextFaultStrategy}.
+ * </p>
+ *
+ * <p>
+ * If no context fault instance is resolved, a new instance will be built using strategy functions which lookup
+ * the {@link FaultCode} {@link QName} and the {@link FaultString} {@link String} values. If no value is produced,
+ * the former defaults to {@link FaultCode#SERVER}. The latter defaults to <code>null</code>.
+ * </p>
[... 446 lines stripped ...]
More information about the commits
mailing list