Examples of XmlRpcClient


Examples of org.apache.xmlrpc.XmlRpcClient

                                          Vector params)
            throws TurbineException
    {
        try
        {
            XmlRpcClient client = new XmlRpcClient(url);
            client.setBasicAuthentication(username, password);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
View Full Code Here

Examples of org.apache.xmlrpc.XmlRpcClient

                             Vector params)
            throws TurbineException
    {
        try
        {
            XmlRpcClient client = new XmlRpcClient(url);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
View Full Code Here

Examples of org.apache.xmlrpc.XmlRpcClient

                                          Vector params)
            throws TurbineException
    {
        try
        {
            XmlRpcClient client = new XmlRpcClient(url);
            client.setBasicAuthentication(username, password);
            return client.execute(methodName, params);
        }
        catch (Exception e)
        {
            throw new TurbineException("XML-RPC call failed", e);
        }
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

         return;
      }
   }
  
   public final static XmlRpcClient getXmlRpcClient(Global glob, XmlRpcUrl xmlRpcUrl, AddressBase address, boolean useCDATA) throws MalformedURLException, XmlBlasterException {
      XmlRpcClient xmlRpcClient = new XmlRpcClient();
      useCDATA = address.getEnv("useCDATA", useCDATA).getValue();

      String transportFactoryName = address.getEnv("transportFactory", "").getValue();
      if (transportFactoryName.trim().length() > 1) {
         log.info("Going to initialize with transport factory " + transportFactoryName);
         try {
            Class<XmlRpcTransportFactory>
               forName = (Class<XmlRpcTransportFactory>) Class.forName(transportFactoryName.trim());
            Constructor<XmlRpcTransportFactory> constr = forName.getConstructor(XmlRpcClient.class);
            XmlRpcTransportFactory
               transportFactory = constr.newInstance(xmlRpcClient);
            xmlRpcClient.setTransportFactory(transportFactory);
         }
         catch (ClassNotFoundException e) {
            log.severe("Exception " + e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
         }
         catch (NoSuchMethodException e) {
            log.severe("Exception " + e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
         }
         catch (InstantiationException e) {
            log.severe("Exception " + e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
         }
         catch (InvocationTargetException e) {
            log.severe("Exception " + e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
         }
         catch (IllegalAccessException e) {
            log.severe("Exception " + e.getClass().getName() + ": " + e.getMessage());
            e.printStackTrace();
         }
        
      }
     
      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) {
         log.info("Going to set proxy for transport factory for " + transportFactory.getClass().getName());
         XmlRpcSun15HttpTransportFactory trFact = (XmlRpcSun15HttpTransportFactory)transportFactory;
         if (proxyHost != null) {
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

            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);
            loginParams.add(username);
            loginParams.add(password);
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

      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";
        String client_secret = "******";
       
       
        String userid = "067201101";
        String domain = "voipt3.multi.fi";
        String first_name = "Matti";
        String middle_i = "X";
        String last_name = "Virtanen";
        String password = "password";
        String community_code = "999";
        String language_code = "fi";
        String email = "matti@.com";
        String adminid = "matti";
       
        String digest = digest_calculate(new Object[]{client_id, userid, domain,
           first_name, middle_i, last_name,
           password, community_code,
           language_code, email, adminid,
           client_secret});
       
  //      $digest = digest_calculate($client_id, $userid, $domain,
  //    $adminid, $client_secret);
  //      $params = array(client_id=>$client_id, digest=>$digest, userid=>$userid,
  //    domain=>$domain, adminid=>$adminid);
       
       
        log.debug(digest);
       
        //function user_info($userid, $domain, $adminid, &$error)
        Object[] params = new Object[]{client_id, digest, userid,
            domain, first_name,
            middle_i, last_name,
            password, community_code,
            language_code, email,
            adminid};
       
       
        Object result = client.execute("OpenSIPg.UserCreate", params);
       
        if (result != null) {
          log.debug(result.getClass().getName());
         
          if (result instanceof Map) {
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

      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";
        String client_secret = "fMXCHeeS6JM9";
       
       
        String userid = "067201101";
        String domain = "voipt3.multi.fi";
        String first_name = "Matti";
        String middle_i = "X";
        String last_name = "Virtanen";
        String password = "password";
        String community_code = "999";
        String language_code = "fi";
        String email = "matti@sucks.com";
        String adminid = "matti";
       
        String digest = digest_calculate(new Object[]{client_id, userid, domain,
           first_name, middle_i, last_name,
           password, community_code,
           language_code, email, adminid,
           client_secret});
       
  //      $digest = digest_calculate($client_id, $userid, $domain,
  //    $adminid, $client_secret);
  //      $params = array(client_id=>$client_id, digest=>$digest, userid=>$userid,
  //    domain=>$domain, adminid=>$adminid);
       
       
        log.debug(digest);
       
        //function user_info($userid, $domain, $adminid, &$error)
        Object[] params = new Object[]{client_id, digest, userid,
            domain, first_name,
            middle_i, last_name,
            password, community_code,
            language_code, email,
            adminid};
       
       
        Object result = client.execute("OpenSIPg.UserCreate", params);
       
        if (result != null) {
          log.debug(result.getClass().getName());
         
          if (result instanceof Map) {
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

      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());
       
        String client_id = "user_admin";
        String client_secret = "******";
       
       
        String userid = "067201101";
        String domain = "voipt3.multi.fi";
        String first_name = "Matti";
        String middle_i = "X";
        String last_name = "Virtanen";
        String password = "password";
        String community_code = "999";
        String language_code = "fi";
        String email = "matti@sucks.com";
        String adminid = "matti";
       
        String digest = this.digest_calculate(new Object[]{client_id, userid, domain,
           first_name, middle_i, last_name,
           password, community_code,
           language_code, email, adminid,
           client_secret});
       
//        $digest = digest_calculate($client_id, $userid, $domain,
//      $adminid, $client_secret);
//        $params = array(client_id=>$client_id, digest=>$digest, userid=>$userid,
//      domain=>$domain, adminid=>$adminid);
       
       
        log.debug(digest);
       
        //function user_info($userid, $domain, $adminid, &$error)
        Object[] params = new Object[]{
            client_id, digest, userid,
            domain, first_name,
            middle_i, last_name,
            password, community_code,
            language_code, email,
            adminid};
       
        //Object[] struct = new Object[]{params};
       
        Object result = client.execute("OpenSIPg.UserCreate", params);
       
        if (result != null) {
          log.debug(result.getClass().getName());
         
          if (result instanceof Map) {
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

    config.setEnabledForExtensions(true);
    config.setBasicUserName(auth_username);
    config.setBasicPassword(password);

    // Create client object
    connection = new XmlRpcClient();
    connection.setConfig(config);
    connection.setTypeFactory(new NonExNullParser(connection));

  }
View Full Code Here

Examples of org.apache.xmlrpc.client.XmlRpcClient

        /// 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);

        //Display the result in the console log
        //This piece of code NEED TO BE CHANGED if you call another function
        System.out.println("An array has been returned. Length is " + result.length);
        for (int i = 0; i < result.length; 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.