*
* @throws MessageEncodingException thrown if the artifact can not be created
*/
protected AbstractSAML2Artifact buildArtifact(SAMLMessageContext artifactContext) throws MessageEncodingException {
SAML2ArtifactBuilder artifactBuilder;
if (artifactContext.getOutboundMessageArtifactType() != null) {
artifactBuilder = Configuration.getSAML2ArtifactBuilderFactory().getArtifactBuilder(
artifactContext.getOutboundMessageArtifactType());
} else {
artifactBuilder = Configuration.getSAML2ArtifactBuilderFactory().getArtifactBuilder(defaultArtifactType);
artifactContext.setOutboundMessageArtifactType(defaultArtifactType);
}
AbstractSAML2Artifact artifact = artifactBuilder.buildArtifact(artifactContext);
String encodedArtifact = artifact.base64Encode();
try {
artifactMap.put(encodedArtifact, artifactContext.getInboundMessageIssuer(), artifactContext
.getOutboundMessageIssuer(), artifactContext.getOutboundSAMLMessage());
} catch (MarshallingException e) {