Examples of XmlRpcClient


Examples of org.apache.xmlrpc.client.XmlRpcClient

    /**
     * Test Xml Rpc by java class call with a Object List
     * @throws Exception
     */
    public void testXmlRpcRequest() throws Exception {
        XmlRpcClient client = this.getRpcClient(url, "admin", "ofbiz");
        Object[] params = new Object[] { 55.00, "message from xml-rpc client" };
        Map<String, Object> result = UtilGenerics.cast(client.execute("testScv", params));
        assertEquals("XML-RPC Service result success", "service done", result.get("resp"));
    }
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

            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

Examples of org.apache.xmlrpc.client.XmlRpcClient

        return keys;
    }
   
    private XmlRpcClient getGeoCoderClient(String username, String password) throws MalformedURLException {
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        XmlRpcClient geocoder = new XmlRpcClient();
       
        if(username != null && password != null){
            config.setServerURL(new URL("http://"+username+":"+password+"@geocoder.us/service/xmlrpc")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        }else{
            config.setServerURL(new URL("http://geocoder.us/service/xmlrpc")); //$NON-NLS-1$
        }
        geocoder.setConfig(config);       
       
        return geocoder;
    }
View Full Code Here

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

Examples of org.apache.xmlrpc.client.XmlRpcClient

        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

Examples of org.apache.xmlrpc.client.XmlRpcClient

    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

Examples of org.apache.xmlrpc.client.XmlRpcClient

        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

Examples of org.apache.xmlrpc.client.XmlRpcClient

    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

Examples of org.apache.xmlrpc.client.XmlRpcClient

  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

Examples of org.apache.xmlrpc.client.XmlRpcClient

            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
TOP
Copyright © 2018 www.massapi.com. 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.