Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClientConfigImpl


            Map actualParameters) throws RemoteException,
            CannotExecuteException {
        try {
            if (client == null) {
                client = new XmlRpcClient();
                XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
                if (serverUrl != null) {
                    config.setServerURL(new URL(serverUrl));
                }
                config.setTimeZone (TimeZone.getTimeZone(timeZone));
                client.setConfig(config);
                client.setTypeFactory
                    (new MyTypeFactory
                     (client, saxTransFact(),
                      serializerTemplates(), parserTemplates()));
View Full Code Here


    protected XmlRpcClientConfigImpl getConfig(ClientProvider pProvider) throws Exception {
        return pProvider.getConfig();
    }

    protected XmlRpcClientConfig getExConfig(ClientProvider pProvider) throws Exception {
        XmlRpcClientConfigImpl config = getConfig(pProvider);
        config.setEnabledForExtensions(true);
        return config;
    }
View Full Code Here

    private XmlRpcClient connect(String hostPort) throws XMLDBException {

        synchronized (this) {
            if (client == null) {
                // Initialize XML-RPC static properties
                XmlRpcClientConfigImpl cfg = new XmlRpcClientConfigImpl();
                cfg.setEncoding("utf-8");
                // FIXME Is XmlRpc.setKeepAlive(true); gone forever?

                /*
                 * Determine the path in the web server to the XML-RPC service.
                 *
                 * In priority order:
                 *   DatabaseImpl service-location property
                 *      (passed in the serviceLocation parameter)
                 *   System property "xindice.xmlrpc.service-location"
                 *   Default value "/xindice/"
                 */
                String serviceLocation = getProperty(PROP_SERVICE_LOCATION);
                if (serviceLocation == null) {
                    serviceLocation = System.getProperty(SYSPROP_SERVICE_LOCATION);
                    if (serviceLocation == null) {
                        serviceLocation = DEFAULT_SERVICE_LOCATION;
                    }
                }
                if (!serviceLocation.startsWith("/")) {
                    serviceLocation = "/" + serviceLocation;
                }
                if (!serviceLocation.endsWith("/")) {
                    serviceLocation = serviceLocation + "/";
                }

                String xmlRpcURL = "http://" + hostPort + serviceLocation;
                if (log.isDebugEnabled()) {
                    log.debug("Using URL: '" + xmlRpcURL + "'");
                }
                try {
                    cfg.setServerURL(new URL(xmlRpcURL));
                } catch (MalformedURLException e) {
                    throw new XMLDBException(ErrorCodes.INVALID_URI, e);
                }

                /*
                 * Determine basic authentication parameters
                 */
                String basicUser = getProperty(PROP_XMLRPC_USER);
                if (basicUser == null) {
                    basicUser = System.getProperty(SYSPROP_XMLRPC_USER);
                }
                if (basicUser != null) {
                    String basicPassword = getProperty(PROP_XMLRPC_PASSWORD);
                    if (basicPassword == null) {
                        basicPassword = System.getProperty(SYSPROP_XMLRPC_PASSWORD);
                    }

                    if (log.isDebugEnabled()) {
                        log.debug("Using Basic authentication. User: '" + basicUser + "', password: '" + basicPassword + "'");
                    }
                    cfg.setBasicUserName(basicPassword);
                    cfg.setBasicPassword(basicPassword);
                }

                client = new XmlRpcClient();
                client.setConfig(cfg);
            }
View Full Code Here

  public final XmlRpcClientConfigImpl getConfig() throws Exception {
    return getConfig(new URL("http://127.0.0.1:" + port + "/"));
  }

  protected XmlRpcClientConfigImpl getConfig(URL pServerURL) throws Exception {
    XmlRpcClientConfigImpl config = super.getConfig();
    config.setServerURL(pServerURL);
    config.setContentLengthOptional(!contentLength);
    return config;
  }
View Full Code Here

    client = new XmlRpcClient();
    client.setTransportFactory(new XmlRpcSunHttpTransportFactory(client));
  }

  protected XmlRpcClientConfigImpl getConfig() {
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    return config;
  }
View Full Code Here

    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    return config;
  }

  protected XmlRpcStreamRequestConfig getExConfig() {
    XmlRpcClientConfigImpl config = getConfig();
    config.setEnabledForExtensions(true);
    return config;
  }
View Full Code Here

    XmlRpcLocalTransportFactory factory = new XmlRpcLocalTransportFactory(pClient);
    return factory;
  }

  public XmlRpcClientConfigImpl getConfig() throws Exception {
    XmlRpcClientConfigImpl config = super.getConfig();
    server = getXmlRpcServer();
        config.setXmlRpcServer(server);
    return config;
  }
View Full Code Here

    protected XmlRpcClientConfigImpl getConfig(ClientProvider pProvider) throws Exception {
        return pProvider.getConfig();
    }

    protected XmlRpcClientConfig getExConfig(ClientProvider pProvider) throws Exception {
        XmlRpcClientConfigImpl config = getConfig(pProvider);
        config.setEnabledForExtensions(true);
        return config;
    }
View Full Code Here

    initWebServer();
    return getConfig(new URL("http://127.0.0.1:" + webServer.getPort() + "/"));
  }

  protected XmlRpcClientConfigImpl getConfig(URL pServerURL) throws Exception {
    XmlRpcClientConfigImpl config = super.getConfig();
    config.setServerURL(pServerURL);
    config.setContentLengthOptional(!contentLength);
    return config;
  }
View Full Code Here

    }

    public List<Issue> getIssueList() throws MalformedURLException, XmlRpcException
    {
        // Create and configure an XML-RPC client
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();

        try
        {
            config.setServerURL( new URL( getUrl() + "/login/xmlrpc" ) );
        }
        catch ( MalformedURLException e )
        {
            throw new MalformedURLException( "The Trac URL is incorrect." );
        }
        config.setBasicUserName( tracUser );
        config.setBasicPassword( tracPassword );

        XmlRpcClient client = new XmlRpcClient();

        client.setConfig( config );
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.client.XmlRpcClientConfigImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.