throw new MessageEncodingException(
"Invalid outbound message transport type, this encoder only support HTTPOutTransport");
}
// Contains the message body
SAMLMessageContext samlMsgCtx = (SAMLMessageContext) messageContext;
SAMLObject samlMessage = samlMsgCtx.getOutboundSAMLMessage();
if (samlMessage == null) {
throw new MessageEncodingException("No outbound SAML message contained in message context");
}
// Add RelayState SOAP header if required
if (samlMsgCtx.getRelayState() != null) {
SOAPHelper.addHeaderBlock(samlMsgCtx, getRelayState(samlMsgCtx.getRelayState()));
}
signMessage(samlMsgCtx);
// Contains the entire envelope with any specified headers, but no body
XMLObject outboundEnveloppe = samlMsgCtx.getOutboundMessage();
Envelope envelope = buildPAOSMessage(samlMessage, outboundEnveloppe);
Element envelopeElem = marshallMessage(envelope);
try {