code: protected Response buildSaml2Response(final Object casAssertion,
                                            final RequestAbstractType authnRequest,
                                            final SamlRegisteredService service,
                                            final SamlRegisteredServiceServiceProviderMetadataFacade adaptor,
                                            final HttpServletRequest request,
                                            final String binding,
                                            final MessageContext messageContext) {
          return (Response)
              getSamlResponseBuilderConfigurationContext().getSamlSoapResponseBuilder()
                  .build(authnRequest, request, null, casAssertion, service, adaptor, binding, messageContext);
      }
docs: Build saml2 response.
  
  @param casAssertion   the cas assertion
  @param authnRequest   the authn request
  @param service        the service
  @param adaptor        the adaptor
  @param request        the request
  @param binding        the binding
  @param messageContext the message context
  @return the org . opensaml . saml . saml 2 . core . response