Search in sources :

Example 6 with XmlRpcClientConfigImpl

use of org.apache.xmlrpc.client.XmlRpcClientConfigImpl in project camel by apache.

the class XmlRpcEndpoint method doStart.

@Override
protected void doStart() throws Exception {
    super.doStart();
    if (clientConfig == null) {
        clientConfig = new XmlRpcClientConfigImpl();
    }
    Map<String, Object> params = new HashMap<String, Object>();
    // do not include null values
    IntrospectionSupport.getProperties(configuration, params, null, false);
    setProperties(clientConfig, params);
}
Also used : HashMap(java.util.HashMap) XmlRpcClientConfigImpl(org.apache.xmlrpc.client.XmlRpcClientConfigImpl)

Example 7 with XmlRpcClientConfigImpl

use of org.apache.xmlrpc.client.XmlRpcClientConfigImpl in project camel by apache.

the class XmlRpcEndpointTest method testEndpointSetting.

// create the endpoint with parameters
@Test
public void testEndpointSetting() throws Exception {
    camelContext.start();
    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());
}
Also used : XmlRpcClientConfigImpl(org.apache.xmlrpc.client.XmlRpcClientConfigImpl) Test(org.junit.Test)

Aggregations

XmlRpcClientConfigImpl (org.apache.xmlrpc.client.XmlRpcClientConfigImpl)7 URL (java.net.URL)4 XmlRpcClient (org.apache.xmlrpc.client.XmlRpcClient)4 MalformedURLException (java.net.MalformedURLException)2 XmlRpcException (org.apache.xmlrpc.XmlRpcException)2 IOException (java.io.IOException)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Issue (org.apache.maven.plugins.issues.Issue)1 XmlRpcCommonsTransportFactory (org.apache.xmlrpc.client.XmlRpcCommonsTransportFactory)1 XmlRpcNotAuthorizedException (org.apache.xmlrpc.common.XmlRpcNotAuthorizedException)1 Test (org.junit.Test)1