code: public String resolveEndpointUri(Message message, String defaultUri) {
          Map<String, Object> headers = message.getHeaders();
  
          String requestUri;
          if (headers.containsKey(ENDPOINT_URI_HEADER_NAME)) {
              requestUri = headers.get(ENDPOINT_URI_HEADER_NAME).toString();
          } else if (StringUtils.hasText(defaultUri)) {
              requestUri = defaultUri;
          } else {
              requestUri = defaultEndpointUri;
          }
  
          if (requestUri == null) {
              throw new CitrusRuntimeException("Unable to resolve dynamic endpoint uri! Neither header entry '" +
                      ENDPOINT_URI_HEADER_NAME + "' nor default endpoint uri is set");
          }
  
          requestUri = appendRequestPath(requestUri, headers);
          requestUri = appendQueryParams(requestUri, headers);
  
          return requestUri;
      }
docs: Get the endpoint uri according to message header entry with fallback default uri.