private SAMLObject dereferenceArtifact(final SAML2Artifact artifact,
                                           final RoleDescriptor peerRoleDescriptor,
                                           final Endpoint ars)
        throws MessageDecodingException {

        try {
            val selfEntityID = resolveSelfEntityID(peerRoleDescriptor);

            // TODO can assume/enforce response as ArtifactResponse here?
            val opContext = new SAMLSOAPClientContextBuilder()
                .setOutboundMessage(buildArtifactResolveRequestMessage(
                    artifact, ars.getLocation(), selfEntityID))
                .setProtocol(SAMLConstants.SAML20P_NS)
                .setPipelineName(soapPipelineName)
                .setSecurityConfigurationProfileId(soapClientSecurityConfigurationProfileId)
                .setPeerRoleDescriptor(peerRoleDescriptor)
                .setSelfEntityID(selfEntityID)
                .build();

            LOGGER.trace("Executing ArtifactResolve over SOAP 1.1 binding to endpoint: {}", ars.getLocation());
            soapClient.send(ars.getLocation(), opContext);
            val response = (SAMLObject) opContext.getInboundMessageContext().getMessage();
            if (response instanceof ArtifactResponse) {
                return validateAndExtractResponseMessage((ArtifactResponse) response);
            } else {
                throw new MessageDecodingException("SOAP message payload was not an instance of ArtifactResponse: "
                    + response.getClass().getName());
            }
        } catch (final MessageException | SOAPException | SecurityException e) {
            throw new MessageDecodingException("Error dereferencing artifact", e);
        }
    }
De-reference the supplied artifact into the corresponding SAML protocol message.

@param artifact           the artifact to de-reference
@param peerRoleDescriptor the peer RoleDescriptor
@param ars                the peer's artifact resolution service endpoint
@return the de-referenced artifact
@throws MessageDecodingException if there is fatal error, or if the artifact was not successfully resolved
pac4j-saml/src/main/java/org/pac4j/saml/transport/Pac4jHTTPArtifactDecoder.java