Package org.apache.xmlrpc.client

Examples of org.apache.xmlrpc.client.XmlRpcClientConfigImpl


      }
     
      XblWriterFactory writerFactory = new XblWriterFactory(useCDATA);
      xmlRpcClient.setXmlWriterFactory(writerFactory);
     
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
     
      int val = address.getEnv("responseTimeout", 0).getValue();
      if (val > 0)
         config.setReplyTimeout(val);
      val = address.getEnv("SoTimeout", 0).getValue();
      if (val > 0)
         config.setConnectionTimeout(val);
     
      String compressType = address.getEnv("compress/type", "").getValue();
      if (Constants.COMPRESS_ZLIB.equals(compressType) || Constants.COMPRESS_ZLIB_STREAM.equals(compressType))
         config.setGzipCompressing(true);
      else
         config.setGzipCompressing(false);

      String proxyHost = address.getEnv("proxyHost", (String)null).getValue();
      String proxyPort = address.getEnv("proxyPort", (String)null).getValue();
      if (proxyPort != null && proxyPort.length() > 0 && proxyHost == null)
         proxyHost = "localhost";
     
      String proxyHostSSL = address.getEnv("proxyHostSSL", proxyHost).getValue();
      String proxyPortSSL = address.getEnv("proxyPortSSL", proxyPort).getValue();
     
      Properties props = System.getProperties();
      synchronized(props) {
         if (proxyHost != null)
            props.setProperty("http.proxySet", "true");
         if (proxyHostSSL != null)
            props.setProperty("https.proxySet", "true");
        
         setProp(props, "http.proxyHost", proxyHost);
         setProp(props, "http.proxyPort", proxyPort);
         setProp(props, "https.proxyHost", proxyHostSSL);
         setProp(props, "https.proxyPort", proxyPortSSL);
      }
     
      String basicUserName = address.getEnv("basicUserName", null).getValue();
      String basicPassword = address.getEnv("basicPassword", null).getValue();
      String basicEncoding = address.getEnv("basicEncoding", null).getValue();
      String userAgent = address.getEnv("userAgent", null).getValue();
      if (basicUserName != null)
         config.setBasicUserName(basicUserName);
      if (basicPassword != null)
         config.setBasicPassword(basicPassword);
      if (basicEncoding != null)
         config.setBasicEncoding(basicEncoding);
      if (userAgent != null)
         config.setUserAgent(userAgent);
      config.setEnabledForExceptions(true);
      config.setEnabledForExtensions(true);
     
      String url = null;
      if (xmlRpcUrl == null) {
         url = address.getRawAddress();
         xmlRpcUrl = new XmlRpcUrl(glob, url);
      }
      else
         url = xmlRpcUrl.getUrl();
      boolean isSSL = url.indexOf("https://") == 0;

      config.setServerURL(new URL(url));
      xmlRpcClient.setConfig(config);
     
      XmlRpcTransportFactory transportFactory = xmlRpcClient.getTransportFactory();
     
      if (transportFactory instanceof XmlRpcSun15HttpTransportFactory) {
View Full Code Here


    private String connectAndLogin(String url, String username, String password) {
        if (url.endsWith("/")) url = url.substring(0, url.length()-1);

        try {
            XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
            config.setServerURL(new URL(url + RPC_PATH));
            config.setConnectionTimeout(prefs.getConnectionTimeoutSeconds().intValue());
            config.setReplyTimeout(prefs.getReplyTimeoutSeconds().intValue());

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

            List loginParams = new ArrayList(2);
View Full Code Here

 
        sc.init(null, trustAllCerts, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
        HttpsURLConnection.setDefaultHostnameVerifier(hv);
     
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
     
      log.debug("config User Agent "+config.getUserAgent());
     
        config.setServerURL(new URL("https://85.134.48.179/manager/xml_rpc_server.php"));
        XmlRpcClient client = new XmlRpcClient();
       
        client.setConfig(config);
       
        String client_id = "user_admin";
View Full Code Here

 
        sc.init(null, trustAllCerts, new java.security.SecureRandom());
        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
        HttpsURLConnection.setDefaultHostnameVerifier(hv);
     
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
     
      log.debug("config User Agent "+config.getUserAgent());
     
        config.setServerURL(new URL("https://85.134.48.179/manager/xml_rpc_server.php"));
        XmlRpcClient client = new XmlRpcClient();
       
        client.setConfig(config);
       
        String client_id = "user_admin";
View Full Code Here

//
//        sc.init(null, trustAllCerts, new java.security.SecureRandom());
//        HttpsURLConnection.setDefaultSSLSocketFactory(sc.getSocketFactory());
//        HttpsURLConnection.setDefaultHostnameVerifier(hv);
//     
      XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
//     
//      log.debug("config User Agent "+config.getUserAgent());
     
//      XmlRpc.setDriver(uk.co.wilson.xml.MinML);
//      //XmlRpc.setDriver(driver)
//      uk.co.wilson.xml.MinML.xmlinfo = true;
//     
     
      config.setUserAgent("OpenSIPg XML_RPC Client");
      config.setEncoding("ISO-8859-1");
     
      config.setGzipCompressing(false);
       
        config.setServerURL(new URL("http://85.134.48.179/manager/xml_rpc_server.php"));
        XmlRpcClient client = new XmlRpcClient();
       
        client.setConfig(config);
       
        client.setXmlWriterFactory(new OpenXGXmlWriterFactory());
View Full Code Here

   * Set up the connection objects.
   */
  protected void setup() {

    // Create configuration object
    config = new XmlRpcClientConfigImpl();
    config.setServerURL(srv_url);
    config.setEnabledForExtensions(true);
    config.setBasicUserName(auth_username);
    config.setBasicPassword(password);

View Full Code Here

        user2.put("timezone", "Pacific/Port_Moresby");
        Object[] users = new Object[]{user1, user2};

        /// XML-RPC CALL
        String serverurl = domainName + "/webservice/xmlrpc/server.php" + "?wstoken=" + token + "&wsfunction=" + functionName;
        XmlRpcClientConfigImpl config = new XmlRpcClientConfigImpl();
        config.setServerURL(new URL(serverurl));
        XmlRpcClient client = new XmlRpcClient();
        client.setConfig(config);
        Object[] params = new Object[]{users};
        Object[] result = (Object[]) client.execute(functionName, params);
View Full Code Here

     */
    private Map<String, Object> serviceInvoker(ModelService modelService, Map<String, Object> context) throws GenericServiceException {
        if (modelService.location == null || modelService.invoke == null)
            throw new GenericServiceException("Cannot locate service to invoke");
       
        XmlRpcClientConfigImpl config = null;
        XmlRpcClient client = null;
        String serviceName = modelService.invoke;
        String engine = modelService.engineName;
        String url = null;
        String login = null;
        String password = null;
        String keyStoreComponent = null;
        String keyStoreName = null;
        String keyAlias  = null;
        try {
            url = ServiceConfigUtil.getEngineParameter(engine, "url");
            login = ServiceConfigUtil.getEngineParameter(engine, "login");
            password = ServiceConfigUtil.getEngineParameter(engine, "password");
            keyStoreComponent = ServiceConfigUtil.getEngineParameter(engine, "keyStoreComponent");
            keyStoreName = ServiceConfigUtil.getEngineParameter(engine, "keyStoreName");
            keyAlias = ServiceConfigUtil.getEngineParameter(engine, "keyAlias");
            config = new XmlRpcClientConfigImpl();
            config.setBasicUserName(login);
            config.setBasicPassword(password);
            config.setServerURL(new URL(url));
        }catch (MalformedURLException e) {
            throw new GenericServiceException("Cannot invoke service : engine parameters are not correct");
        }
        catch (GenericConfigException e) {
            throw new GenericServiceException("Cannot invoke service : engine parameters are not correct");
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

        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.setConfig( config );
        ClientFactory factory = new ClientFactory( client );
        continuum = (ContinuumService) factory.newInstance( ContinuumService.class );
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.