Package org.apache.xmlrpc.client.util

Examples of org.apache.xmlrpc.client.util.ClientFactory.newInstance()


        config.setServerURL( serviceUrl );

        XmlRpcClient client = new XmlRpcClient();
        client.setConfig( config );
        ClientFactory factory = new ClientFactory( client );
        continuum = (ContinuumService) factory.newInstance( ContinuumService.class );
    }

    public boolean ping()
        throws Exception
    {
View Full Code Here


        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;
       
        // make proxied calls
        System.out.println("Weekday("+year+","+month+","+day+")       = "+ calendar.getWeekday(year, month, day));
View Full Code Here

        for (int i = 0;  i < 3;  i++) {
            assertEquals(new Integer(2-i), result[i]);
        }

        ClientFactory factory = new ClientFactory(client);
        XMLRPC89Handler handler = (XMLRPC89Handler) factory.newInstance(XMLRPC89Handler.class);
        Vector resultVector = handler.reverse(values);
        assertNotNull(resultVector);
        assertEquals(3, resultVector.size());
        for (int i = 0;  i < 3;  i++) {
            assertEquals(new Integer(2-i), resultVector.get(i));
View Full Code Here

        client.setConfig(getConfig(pProvider));
        Object res = client.execute(XMLRPC89Handler.class.getName() + ".doubledValues", new Object[]{values});
        verifyXMLRPC89Hashtable((Map) res);

        ClientFactory factory = new ClientFactory(client);
        XMLRPC89Handler handler = (XMLRPC89Handler) factory.newInstance(XMLRPC89Handler.class);
        Hashtable result = handler.doubledValues(values);
        verifyXMLRPC89Hashtable(result);
    }

    private void verifyXMLRPC89Properties(Map pMap) {
View Full Code Here

        client.setConfig(getConfig(pProvider));
        Object res = client.execute(XMLRPC89Handler.class.getName() + ".doubledPropertyValues", new Object[]{values});
        verifyXMLRPC89Properties((Map) res);

        ClientFactory factory = new ClientFactory(client);
        XMLRPC89Handler handler = (XMLRPC89Handler) factory.newInstance(XMLRPC89Handler.class);
        Properties result = handler.doubledPropertyValues(values);
        verifyXMLRPC89Properties(result);
    }

    /** Handler for XMLRPC-96
View Full Code Here

        }
    }

    private void testAdderCall(ClientProvider pProvider) throws Exception {
        ClientFactory factory = getClientFactory(pProvider);
        Adder adder = (Adder) factory.newInstance(Adder.class);
        assertEquals(6, adder.add(2, 4));
    }
}
View Full Code Here

        }
    }

    private void testAdderCall(ClientProvider pProvider) throws Exception {
        ClientFactory factory = getClientFactory(pProvider);
        Adder adder = (Adder) factory.newInstance(Adder.class);
        assertEquals(6, adder.add(2, 4));
    }

    /** Tests trapping a SAXException.
     */
 
View Full Code Here

        }
    }

    private void testParseCall(ClientProvider pProvider) throws Exception {
        ClientFactory factory = getExClientFactory(pProvider);
        Adder adder = (Adder) factory.newInstance(Adder.class);
        try {
            adder.parse("foo");
            fail("Expected SAXException");
        } catch (SAXException e) {
            // Ok
View Full Code Here

        }
    }

    private void testVoidMethod(ClientProvider pProvider) throws Exception {
        ClientFactory factory = getExClientFactory(pProvider);
        Adder adder = (Adder) factory.newInstance(Adder.class);
        adder.ping();
    }
}
View Full Code Here

        for (int i = 0;  i < 3;  i++) {
            assertEquals(new Integer(2-i), result[i]);
        }

        ClientFactory factory = new ClientFactory(client);
        XMLRPC89Handler handler = (XMLRPC89Handler) factory.newInstance(XMLRPC89Handler.class);
        Vector resultVector = handler.reverse(values);
        assertNotNull(resultVector);
        assertEquals(3, resultVector.size());
        for (int i = 0;  i < 3;  i++) {
            assertEquals(new Integer(2-i), resultVector.get(i));
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.