Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClientConfigImpl


   * Undocumented in supervisord API
   *
   * @throws MalformedURLException
   */
  private void setconfig() throws MalformedURLException {
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();

    // Setting timeouts for xmlrpc calls made using
    // XmlRpcSunHttpTransportFactory, the default connection factory
    int xmlrpcConnTimeout = 1000; // Connection timeout
    int xmlrpcReplyTimeOut = 6000; // Reply timeout

    config.setConnectionTimeout(xmlrpcConnTimeout);
    config.setReplyTimeout(xmlrpcReplyTimeOut);
    config.setEncoding("UTF-8");

    if (user != null && password != null) {
      config.setBasicUserName(user);
      config.setBasicPassword(password);
    }
    config.setServerURL(new URL("http://" + host + ":" + port + "/RPC2/"));
    client.setConfig(config);
    client.setTypeFactory(new MyTypeFactory(client));
  }
View Full Code Here


public class Clp20SimUtility {
  static public ProxyICoSimProtocol connect(URL url)
      throws SimulationException {
    ProxyICoSimProtocol protocolProxy = null;
    try {
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
      config.setServerURL(url);
      // config.setReplyTimeout(5000);// 5 sec time out

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

      throws SimulationException
  {
    ProxyICoSimProtocol protocolProxy = null;
    try
    {
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
      config.setServerURL(url);

      // 0 sec timeout = no timeout and fixes Bert problem
      config.setReplyTimeout(000);// 5 sec time out

      XmlRpcClient client = new XmlRpcClient();
      client.setConfig(config);

      if (SimulationEngine.eclipseEnvironment)
View Full Code Here

        this( serviceUrl, null, null );
    }

    public ContinuumXmlRpcClient( URL serviceUrl, String login, String password )
    {
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl()
        {
            public boolean isEnabledForExtensions()
            {
                return true;
            }
        };

        if ( login != null )
        {
            config.setBasicUserName( login );
            config.setBasicPassword( password );
        }
        config.setServerURL( serviceUrl );

        XmlRpcClient client = new XmlRpcClient();
        client.setConfig( config );
        ClientFactory factory = new ClientFactory( client );
        continuum = (ContinuumService) factory.newInstance( ContinuumService.class );
View Full Code Here

            port = pPort;
        }
        public void run() {
            try {
                XmlRpcClient client = new XmlRpcClient();
                XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
                config.setServerURL(new URL("http://127.0.0.1:" + port + "/"));
                client.setConfig(config);
                for (int i = 0;  i < iterations;  i++) {
                    assertEquals(EIGHT, client.execute("Adder.add", new Object[]{THREE, FIVE}));
                }
            } catch (Throwable t) {
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

        // application configuration
        final CompositeConfiguration appConfig = this.createApplicationConfiguration();
        // XML-RPC client specific configuration, using the application
        // configuration
        final XmlRpcClientConfigImpl config = this.createXmlRpcClientConfiguration(url, appConfig);
        this.xmlRpcClient.setConfig(config);

        this.testProjectService = new TestProjectService(xmlRpcClient, devKey);
        this.testPlanService = new TestPlanService(xmlRpcClient, devKey);
        this.miscService = new MiscService(xmlRpcClient, devKey);
View Full Code Here

     * @param url Application URL.
     * @param appConfig Application composite configuration.
     * @return XML-RPC client configuration.
     */
    private XmlRpcClientConfigImpl createXmlRpcClientConfiguration(URL url, CompositeConfiguration appConfig) {
        final XmlRpcClientConfigImpl xmlRpcClientConfig = new XmlRpcClientConfigImpl();

        xmlRpcClientConfig.setServerURL(url);
        xmlRpcClientConfig.setEnabledForExtensions(true);

        xmlRpcClientConfig.setBasicEncoding(appConfig.getString(XMLRPC_BASIC_ENCODING));
        xmlRpcClientConfig.setBasicPassword(appConfig.getString(XMLRPC_BASIC_PASSWORD));
        xmlRpcClientConfig.setBasicUserName(appConfig.getString(XMLRPC_BASIC_USERNAME));

        try {
            xmlRpcClientConfig.setConnectionTimeout(appConfig.getInt(XMLRPC_CONNECTION_TIMEOUT));
        } catch (ConversionException ce) {
            this.debug(ce);
        } catch (NoSuchElementException nsee) {
            this.debug(nsee);
        }

        try {
            xmlRpcClientConfig.setContentLengthOptional(appConfig.getBoolean(XMLRPC_CONTENT_LENGTH_OPTIONAL));
        } catch (ConversionException ce) {
            this.debug(ce);
        } catch (NoSuchElementException nsee) {
            this.debug(nsee);
        }

        try {
            xmlRpcClientConfig.setEnabledForExceptions(appConfig.getBoolean(XMLRPC_ENABLED_FOR_EXCEPTIONS));
        } catch (ConversionException ce) {
            this.debug(ce);
        } catch (NoSuchElementException nsee) {
            this.debug(nsee);
        }

        xmlRpcClientConfig.setEncoding(appConfig.getString(XMLRPC_ENCODING));

        try {
            xmlRpcClientConfig.setGzipCompressing(appConfig.getBoolean(XMLRPC_GZIP_COMPRESSION));
        } catch (ConversionException ce) {
            this.debug(ce);
        } catch (NoSuchElementException nsee) {
            this.debug(nsee);
        }

        try {
            xmlRpcClientConfig.setGzipRequesting(appConfig.getBoolean(XMLRPC_GZIP_REQUESTING));
        } catch (ConversionException ce) {
            this.debug(ce);
        } catch (NoSuchElementException nsee) {
            this.debug(nsee);
        }

        try {
            xmlRpcClientConfig.setReplyTimeout(appConfig.getInt(XMLRPC_REPLY_TIMEOUT));
        } catch (ConversionException ce) {
            this.debug(ce);
        } catch (NoSuchElementException nsee) {
            this.debug(nsee);
        }

        xmlRpcClientConfig.setUserAgent(appConfig.getString(XMLRPC_USER_AGENT));

        return xmlRpcClientConfig;
    }
View Full Code Here

    public org.apache.xmlrpc.client.XmlRpcClient getRpcClient(String url) throws MalformedURLException {
        return getRpcClient(url, null, null);
    }

    public org.apache.xmlrpc.client.XmlRpcClient getRpcClient(String url, String login, String password) throws MalformedURLException {
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        config.setServerURL(new URL(url));
        if (login != null) {
            config.setBasicUserName(login);
        }
        if (password != null) {
            config.setBasicPassword(password);
        }

        if (keyStoreComponent != null && keyStoreName != null && keyAlias != null) {
            return new XmlRpcClient(config, keyStoreComponent, keyStoreName, keyAlias);
        } else {
View Full Code Here

        return (T) Proxy.newProxyInstance( getClass().getClassLoader(), new Class[]{bindClass}, handler );
    }

    private XmlRpcClient getXmlRpcClient( URL url, ConnectionInfo connectionInfo )
    {
        XmlRpcClientConfigImpl clientConfig = new XmlRpcClientConfigImpl();
        clientConfig.setServerURL( url );
        clientConfig.setEnabledForExceptions( true );

        if ( connectionInfo != null )
        {
            clientConfig.setBasicUserName( connectionInfo.getUsername() );
            clientConfig.setBasicPassword( connectionInfo.getPassword() );
            clientConfig.setBasicEncoding( connectionInfo.getEncoding() );
            clientConfig.setGzipCompressing( connectionInfo.isGzip() );
            clientConfig.setGzipRequesting( connectionInfo.isGzip() );
            clientConfig.setReplyTimeout( connectionInfo.getTimeout() );
            clientConfig.setConnectionTimeout( connectionInfo.getTimeout() );
            clientConfig.setTimeZone( connectionInfo.getTimeZone() );
        }

        final XmlRpcClient client = new XmlRpcClient();
        client.setTypeFactory( new BinderTypeFactory( client ) );
        XmlRpcCommonsTransportFactory factory = new XmlRpcCommonsTransportFactory( client );
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.