Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClientConfigImpl


    }

    private void testCustomDateFormat(ClientProvider pProvider) throws Exception {
        final DateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
        XmlRpcClient client = pProvider.getClient();
        XmlRpcClientConfigImpl config = getConfig(pProvider);
        client.setConfig(config);
        TypeFactory typeFactory = getCustomDateTypeFactory(client, format);
        client.setTypeFactory(typeFactory);
        Calendar cal1 = Calendar.getInstance();
        XmlRpcRequest request = new XmlRpcClientRequestImpl(config, "DateConverter.tomorrow", new Object[]{cal1.getTime()});
View Full Code Here


  public EmbetClientXMLRPC(String _embetURL) throws IOException {
    if (_embetURL != null && !_embetURL.equals(""))
      embetURL = _embetURL;

      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
      System.out.println("Connecting to: " + embetURL);
      config.setServerURL(new URL(embetURL));
      config.setEncoding("utf-8");
      c = new XmlRpcClient();
      c.setConfig(config);


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.setTransportFactory( new XmlRpcCommonsTransportFactory( client ) );
        client.setConfig( config );
        ClientFactory factory = new ClientFactory( client );
View Full Code Here

public class Main {

    public static void main(String[] args) throws MalformedURLException, XmlRpcException {
        System.out.println("OpenERP Java XMLRPC Test Client");
        XmlRpcClient xmlRpcLogin = new XmlRpcClient();
        XmlRpcClientConfigImpl xmlRpcLoginConfig = new XmlRpcClientConfigImpl();

        /*
         * 1. First step, login
         */
        xmlRpcLoginConfig.setServerURL(new URL("http", "127.0.0.1", 8069, "/xmlrpc/common"));
        xmlRpcLogin.setConfig(xmlRpcLoginConfig);
        Vector<String> params = new Vector<String>();
        params.add("db_test_session");
        params.add("admin")// login
        params.add("admin")// password
View Full Code Here

   * @param apiUrl
   *            url
   */
  public OrigoApiClient(final URL apiUrl) {
    client = new XmlRpcClient();
    XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
    config.setServerURL(apiUrl);
    client.setConfig(config);
  }
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

        if (logger.isDebugEnabled()) {
            logger.debug("Executing ping to '" + pingTargetUrl + "' for website '" + websiteUrl + "' (" + website.getName() + ")" + (variantOptions.isEmpty() ? "" : " with variant options " + variantOptions));
        }

        // Send the ping.
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        config.setServerURL(new URL(pingTargetUrl));
        XmlRpcClient client = new XmlRpcClient();
        client.setConfig(config);
        PingResult pingResult = parseResult(client.execute("weblogUpdates.ping", params.toArray()));

        if (logger.isDebugEnabled()) logger.debug("Ping result is: " + pingResult);
View Full Code Here

   
    // create the endpoint with parameters
    @Test
    public void testEndpointSetting() throws Exception {
        XmlRpcEndpoint endpoint = (XmlRpcEndpoint)camelContext.getEndpoint("xmlrpc:http://www.example.com?userAgent=myAgent&gzipCompressing=true&connectionTimeout=30&defaultMethodName=echo");
        XmlRpcClientConfigImpl clientConfig = endpoint.getClientConfig();
        assertEquals("Get a wrong userAgent", "myAgent", clientConfig.getUserAgent());
        assertEquals("Get a wrong gzipCompressing", true, clientConfig.isGzipCompressing());
        assertEquals("Get a wrong connectionTimeout", 30, clientConfig.getConnectionTimeout());
        assertEquals("Get a wrong endpoint address", "http://www.example.com", endpoint.getAddress());
        assertEquals("Get a worng default method name", "echo", endpoint.getDefaultMethodName());
    }
View Full Code Here

public class MyClientConfigurer implements XmlRpcClientConfigurer {

    @Override
    public void configureXmlRpcClient(XmlRpcClient client) {
        // get the configure first
        XmlRpcClientConfigImpl clientConfig = (XmlRpcClientConfigImpl)client.getClientConfig();
        // change the value of clientConfig
        clientConfig.setEnabledForExtensions(true);
        // set the option on the XmlRpcClient
        client.setMaxThreads(10);
    }
View Full Code Here

public class XmlRpcComponent extends DefaultComponent {

    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        // current we just use the uri as the server address
        XmlRpcEndpoint endpoint = new XmlRpcEndpoint(uri, this, remaining);
        XmlRpcClientConfigImpl clientConfig = endpoint.getClientConfig();
        // find out the clientConfigurer first
        XmlRpcClientConfigurer clientConfigurer = resolveAndRemoveReferenceParameter(parameters, "clientConfigurer", XmlRpcClientConfigurer.class);
        endpoint.setClientConfigurer(clientConfigurer);
        // we just use the XmlRpcClientConfig to take the parameters
        setProperties(clientConfig, parameters);
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.