protected String constructServiceUrl(final HttpServletRequest request,
                                         final HttpServletResponse response,
                                         final WSFederationRequest wsfedRequest) throws Exception {
        val builder = new URIBuilder(configContext.getCallbackService().getId());

        builder.addParameter(WSFederationConstants.WA, wsfedRequest.wa());
        builder.addParameter(WSFederationConstants.WREPLY, wsfedRequest.wreply());
        builder.addParameter(WSFederationConstants.WTREALM, wsfedRequest.wtrealm());

        if (StringUtils.isNotBlank(wsfedRequest.wctx())) {
            builder.addParameter(WSFederationConstants.WCTX, wsfedRequest.wctx());
        }
        if (StringUtils.isNotBlank(wsfedRequest.wfresh())) {
            builder.addParameter(WSFederationConstants.WREFRESH, wsfedRequest.wfresh());
        }
        if (StringUtils.isNotBlank(wsfedRequest.whr())) {
            builder.addParameter(WSFederationConstants.WHR, wsfedRequest.whr());
        }
        if (StringUtils.isNotBlank(wsfedRequest.wreq())) {
            builder.addParameter(WSFederationConstants.WREQ, wsfedRequest.wreq());
        }
        val url = builder.build().toASCIIString();
        LOGGER.trace("Built service callback url [{}]", url);
        return url;
    }
This is {@link BaseWSFederationRequestController}.

@author Misagh Moayyed
@since 5.1.0
support/cas-server-support-ws-idp/src/main/java/org/apereo/cas/ws/idp/web/BaseWSFederationRequestController.java