Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClient


    }
   
    /** Returns a List<SimpleFeature> of ADDRESS */
    public Point where(String address) throws IOException,XmlRpcException {
        GeometryFactory fac = new GeometryFactory();       
        XmlRpcClient geocoder = getGeoCoderClient(username, password);
       
        Vector params = new Vector();
        params.addElement(address);
        // this method returns a string
        Vector vec = (Vector)geocoder.execute("geocode", params); //$NON-NLS-1$
        System.out.println("vec"+vec); //$NON-NLS-1$
       
        Hashtable table = (Hashtable)vec.get(0);
        double lat = ((Number)table.get("lat")).doubleValue(); //$NON-NLS-1$
        double lon = ((Number)table.get("long")).doubleValue(); //$NON-NLS-1$
View Full Code Here


        return p;
    }
   
    public List<SimpleFeature> geocode(String address) throws IOException,XmlRpcException {
        GeometryFactory fac = new GeometryFactory();     
        XmlRpcClient geocoder = getGeoCoderClient(username, password);
       
        Vector params = new Vector();
        params.addElement(address);
       
        // this method returns a string
        Vector<Hashtable<String,Object>> vec = (Vector<Hashtable<String,Object>>)geocoder.execute("geocode", params); //$NON-NLS-1$
        System.out.println("vec"+vec); //$NON-NLS-1$

        List<String> keys = keys( vec );
        SimpleFeatureType ADDRESS = createAddressType( keys );
       
View Full Code Here

    try {
      config.setServerURL(new URL(url));
    } catch (java.net.MalformedURLException ex) {
      throw new LdtpExecutionError(ex.getMessage());
    }
    client = new XmlRpcClient();
    client.setConfig(config);
    Boolean alive = isAlive();
    if (!alive) {
      if (serverAddr.contains("localhost"))
        launchLdtpProcess();
View Full Code Here

        config.setServerURL(new URL("http://localhost:8080/jquantlib-xmlrpc/xmlrpc"));
        config.setEnabledForExtensions(true);
        config.setConnectionTimeout(60 * 1000);
        config.setReplyTimeout(60 * 1000);

        XmlRpcClient client = new XmlRpcClient();

        // use Commons HttpClient as transport
        client.setTransportFactory(new XmlRpcCommonsTransportFactory(client));
        // set configuration
        client.setConfig(config);

        ClientFactory factory = new ClientFactory(client);
        CalendarWidget calendar = (CalendarWidget) factory.newInstance(CalendarWidget.class);
       
        int year=2005, month=11, day=13;
View Full Code Here

    public XmlRpcTests(String name) {
        super(name);
    }

    public void testXmlRpcRequest() throws Exception {
        XmlRpcClient client = this.getRpcClient(url, "admin", "ofbiz");
        Object[] params = new Object[] { 55.00, "message from xml-rpc client" };
        Map result = (Map) client.execute("testScv", params);
        assertEquals("XML-RPC Service result success", "service done", result.get("resp"));
    }
View Full Code Here

  String _ip;
  Integer _port = 8899;
  Boolean _isSsl = false;
 
  private XmlRpcClient getXmlClient() {
    XmlRpcClient client = new XmlRpcClient();
   
    URL url;
    try {
      url = new URL("http://" + _ip + ":" + _port.toString());
      _config.setTimeZone(TimeZone.getTimeZone("UTC"));
      _config.setServerURL(url);
      _config.setReplyTimeout(0); // disable, we use asyncexecute to control timeout
      _config.setConnectionTimeout(6000);
      _config.setBasicUserName(_username);
      _config.setBasicPassword(_password);
      client.setConfig(_config);
    } catch (MalformedURLException e) {
      throw new CloudRuntimeException(e.getMessage());
    }
   
    return client;
View Full Code Here

            if (username != null && password != null) {
                config.setBasicUserName(username);
                config.setBasicPassword(password);
            }

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

            if (StringUtils.hasValue(testMethodName))
                connection.execute(testMethodName, Collections.EMPTY_LIST);
           
            if (!validateCredentials(connection, username, password))
                throw new ErrorDataValueException(BAD_USERNAME_PASS,
                        ErrorData.SEVERE);
View Full Code Here

        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        config.setServerURL(url);
        config.setBasicUserName(args[1]);
        config.setBasicPassword(args[2]);

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

        try {
            execute(client, "getServerVersion");
        } catch (Exception e) {
            throw new RuntimeException("Unable to contact server " + baseUrl
View Full Code Here

    protected XmlRpcClient openConnectionImpl() throws ErrorDataValueException {
        // assume the most recent version of the server, and try to connect.
        this.urlSuffix = new DynamicAttributeValue(URL_SUFFIX_4);
        this.namespace = NAMESPACE4;
        this.testMethodName = NAMESPACE4 + TEST_METHOD_NAME;
        XmlRpcClient result = super.openConnectionImpl(true);

        // if that fails, try connecting to the older server API.
        if (result == null) {
            this.urlSuffix = new DynamicAttributeValue(URL_SUFFIX_3);
            this.namespace = NAMESPACE3;
View Full Code Here

    {
        config.setTimeZone(TimeZone.getTimeZone("UTC"));
        config.setServerURL(url);
        config.setReplyTimeout(_wait * 1000);
        config.setConnectionTimeout(5000);
        XmlRpcClient client = new XmlRpcClient();
        client.setConfig(config);
        return client;
    }
View Full Code Here

TOP

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

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.