コード例 #1
0
  protected XmlRpcHttpRequestConfig getXmlRpcConfig(HttpServletRequest req) {
    XmlRpcHttpRequestConfigImpl result = new XmlRpcHttpRequestConfigImpl();
    XmlRpcHttpServerConfig serverConfig = (XmlRpcHttpServerConfig) getConfig();

    result.setBasicEncoding(serverConfig.getBasicEncoding());
    result.setContentLengthOptional(serverConfig.isContentLengthOptional());
    result.setEnabledForExtensions(serverConfig.isEnabledForExtensions());
    result.setGzipCompressing(HttpUtil.isUsingGzipEncoding(req.getHeader("Content-Encoding")));
    result.setGzipRequesting(HttpUtil.isUsingGzipEncoding(req.getHeaders("Accept-Encoding")));
    result.setEncoding(req.getCharacterEncoding());
    // result.setEnabledForExceptions(serverConfig.isEnabledForExceptions());
    HttpUtil.parseAuthorization(result, req.getHeader("Authorization"));

    // context overrides
    if (enabledForExtensions != null) {
      result.setEnabledForExtensions(enabledForExtensions);
    }
    if (enabledForExceptions != null) {
      result.setEnabledForExtensions(enabledForExceptions);
    }
    return result;
  }
コード例 #2
0
 /**
  * Sets Authentication for this client. This will be sent as Basic Authentication header to the
  * server as described in <a href="http://www.ietf.org/rfc/rfc2617.txt">
  * http://www.ietf.org/rfc/rfc2617.txt</a>.
  */
 public void setBasicAuthentication(String user, String password) {
   auth = HttpUtil.encodeBasicAuthentication(user, password);
 }