@Override public String getBindingURI(final SAML2MessageContext messageContext) { if (messageContext.getSOAP11Context().getEnvelope() != null) { return SAMLConstants.SAML2_SOAP11_BINDING_URI; } else { return SAMLConstants.SAML2_POST_BINDING_URI; } } }
/** * Add a header block to the SOAP envelope contained within the specified message context's * SOAP subcontext. * * @param messageContext the message context being processed * @param headerBlock the header block to add */ public static void addHeaderBlock(@Nonnull final MessageContext messageContext, @Nonnull final XMLObject headerBlock) { Constraint.isNotNull(messageContext, "Message context cannot be null"); // SOAP 1.1 Envelope final SOAP11Context soap11 = getSOAP11Context(messageContext, false); if (soap11 != null && soap11.getEnvelope() != null) { addSOAP11HeaderBlock(soap11.getEnvelope(), headerBlock); } else { //TODO SOAP 1.2 support when object providers are implemented throw new IllegalArgumentException("Message context did not contain a SOAP Envelope"); } }
/** * Determine the SOAP version of the message represented by the message context. * * @param messageContext the current message context * @return the SOAP version. May be null if the version could not be determined. */ @Nullable public static SOAPVersion getSOAPVersion( @Nonnull final MessageContext<? extends XMLObject> messageContext) { Constraint.isNotNull(messageContext, "Message context cannot be null"); final SOAP11Context soap11 = getSOAP11Context(messageContext, false); // SOAP 1.1 Envelope if (soap11 != null && soap11.getEnvelope() != null) { return SOAP_1_1; } //TODO SOAP 1.2 support when object providers are implemented return null; }
/** {@inheritDoc} */ @Override protected XMLObject getMessageToLog() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** * Retrieve the previously stored SOAP envelope from the message context. * * @return the previously stored SOAP envelope */ protected Envelope getSOAPEnvelope() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** {@inheritDoc} */ @Override protected XMLObject getMessageToLog() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** * Get a header block from the SOAP envelope contained within the specified message context's * SOAP subcontext. * * @param messageContext the message context being processed * @param headerName the name of the header block to return * @param targetNodes the explicitly specified SOAP node actors (1.1) or roles (1.2) for which the header is desired * @param isFinalDestination true specifies that headers targeted for message final destination should be returned, * false means they should not be returned * * @return the list of matching header blocks */ @Nonnull public static List<XMLObject> getHeaderBlock( @Nonnull final MessageContext messageContext, @Nonnull final QName headerName, @Nullable Set<String> targetNodes, boolean isFinalDestination) { Constraint.isNotNull(messageContext, "Message context cannot be null"); final SOAP11Context soap11 = getSOAP11Context(messageContext, false); // SOAP 1.1 Envelope if (soap11 != null && soap11.getEnvelope() != null) { return getSOAP11HeaderBlock(soap11.getEnvelope(), headerName, targetNodes, isFinalDestination); } //TODO SOAP 1.2 support when object providers are implemented return Collections.emptyList(); }
/** * Retrieve the previously stored SOAP envelope from the message context. * * @return the previously stored SOAP envelope */ protected Envelope getSOAPEnvelope() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** {@inheritDoc} */ @Override protected XMLObject getMessageToLog() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** * Retrieve the previously stored SOAP envelope from the message context. * * @return the previously stored SOAP envelope */ protected Envelope getSOAPEnvelope() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** {@inheritDoc} */ protected XMLObject getMessageToLog() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** {@inheritDoc} */ protected XMLObject getMessageToLog() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** {@inheritDoc} */ protected XMLObject getMessageToLog() { return getMessageContext().getSubcontext(SOAP11Context.class, true).getEnvelope(); }
/** {@inheritDoc} */ protected void doInvoke(@Nonnull MessageContext<Envelope> messageContext) throws MessageHandlerException { Envelope env = (Envelope) messageContext.getSubcontext(SOAP11Context.class).getEnvelope(); if (env == null) { throw new MessageHandlerException("MessageContext did not contain a SOAP Envelope"); } messageContext.setMessage(env); }
/** {@inheritDoc} */ protected void doInvoke(MessageContext messageContext) throws MessageHandlerException { Envelope env = (Envelope) messageContext.getSubcontext(SOAP11Context.class).getEnvelope(); List<XMLObject> bodyChildren = env.getBody().getUnknownXMLObjects(); if (bodyChildren == null || bodyChildren.isEmpty()) { throw new MessageHandlerException("SOAP Envelope Body contained no children"); } else if (bodyChildren.size() > 1) { log.warn("SOAP Envelope Body contained more than one child. Returning the first as the message"); } messageContext.setMessage(env.getBody().getUnknownXMLObjects().get(0)); }
throw new MessageHandlerException("SOAP 1.1 context was not present in message context"); final Envelope soapMessage = soap11Context.getEnvelope(); if (soapMessage == null) { throw new MessageHandlerException("SOAP 1.1 envelope was not present in SOAP context");
throw new MessageHandlerException("SOAP 1.1 context was not present in message context"); final Envelope soapMessage = soap11Context.getEnvelope(); if (soapMessage == null) { throw new MessageHandlerException("SOAP 1.1 envelope was not present in SOAP context");
LOGGER.debug("Handling ECP request for SOAP context [{}]", soapContext); val envelope = soapContext.getSubcontext(SOAP11Context.class).getEnvelope(); SamlUtils.logSamlObject(configBean, envelope);
if (soapCtx == null || soapCtx.getEnvelope() == null) { throw new SOAPClientException("Operation context did not contain an outbound SOAP Envelope"); } else if (clientCtx != null) { post = createPostMethod(endpoint, soapRequestParams, soapCtx.getEnvelope());