Package org.apache.xmlrpc

Examples of org.apache.xmlrpc.XmlRpcClient


      System.out.println(" username=" + username);
      System.out.println(" password=********");
      System.out.println(" content=" + buf.toString());
      System.out.println(" publish=true");

      XmlRpcClient xmlrpc = new XmlRpcClient(url);
      Vector params = new Vector();
      params.add(APP_KEY);
      params.add(blogid);
      params.add(username);
      params.add(password);
      params.add(buf.toString());
      params.add(Boolean.TRUE);
      Object postId = xmlrpc.execute(handler + ".newPost", params);

      System.out.println("New post id is " + postId);

    } catch (Exception e) {
      throw new BuildException(e);
View Full Code Here


   *
   */
  public void run() {
    try {
      PluginProperties props = blog.getPluginProperties();
      XmlRpcClient xmlrpc = new XmlRpcClient(props.getProperty(getPropertyPrefix() + XMLRPC_URL_KEY));
      Vector<Object> params = new Vector<Object>();
      params.add(props.getProperty(getPropertyPrefix() + BLOG_KEY));
      params.add(props.getProperty(getPropertyPrefix() + USERNAME_KEY));
      params.add(props.getProperty(getPropertyPrefix() + PASSWORD_KEY));

      int numberOfBlogEntries = 10;
      try {
        numberOfBlogEntries = Integer.parseInt(props.getProperty(getPropertyPrefix() + BLOG_ENTRIES_KEY));
      } catch (NumberFormatException nfe) {
        // do nothing, the value has already been defaulted
      }
      params.add(numberOfBlogEntries);

      // get the remote blog entries
      Vector<Hashtable> remoteBlogEntries = (Vector<Hashtable>)xmlrpc.execute("pebble.getRecentBlogEntries", params);

      // loop through them and add them to the local blog
      for (Hashtable remoteBlogEntry : remoteBlogEntries) {
        String id = (String)remoteBlogEntry.get(PebbleAPIHandler.ID);
        String title = (String)remoteBlogEntry.get(PebbleAPIHandler.TITLE);
View Full Code Here

  public void sendUpdateNotificationPing(Blog blog, String url, String[] sites) {
    try {
      for (String site : sites) {
        log.info("Sending XML-RPC ping to " + site);
        blog.info("Sending XML-RPC ping to " + StringUtils.transformHTML(site));
        XmlRpcClient xmlrpc = new XmlRpcClient(site);
        Vector params = new Vector();
        params.addElement(blog.getName());
        params.addElement(url);
        xmlrpc.executeAsync(WEBLOGS_METHOD_NAME, params, new UpdateNotificationPingsAsyncCallback(blog));
      }
    } catch (IOException ioe) {
      log.error(ioe.getMessage(), ioe);
    }
  }
View Full Code Here

      Object o = parameters.get(i);
      assert o != null : "Null parameter in position " + i;
    }

    try {
      return new XmlRpcClient(url).execute(fullMethodName, new Vector<Object>(parameters));
    }
    catch (MalformedURLException e) {
      LOG.info(buildFullLogLine(logLine, parameters) + ' ' + e.getLocalizedMessage());
    }
    catch (IOException e) {
View Full Code Here

                             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

                                          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

        if (logger.isDebugEnabled()) {
            logger.debug("Executing ping to '" + pingTargetUrl + "' for website '" + websiteUrl + "' (" + website.getName() + ")" + (variantOptions.isEmpty() ? "" : " with variant options " + variantOptions));
        }

        // Send the ping.
        XmlRpcClient client = new XmlRpcClient(pingTargetUrl);
        PingResult pingResult = parseResult(client.execute("weblogUpdates.ping", params));

        if (logger.isDebugEnabled()) logger.debug("Ping result is: " + pingResult);
        return pingResult;
    }
View Full Code Here

   * @param basepath the basepath
   * @throws MalformedURLException
   */
  public AbstractService(String basepath) throws MalformedURLException {
    super();
    this.client = new XmlRpcClient(basepath + "/" + getService());
  }
View Full Code Here

   * @param basepath the basepath
   * @throws MalformedURLException
   */
  public AbstractService(String basepath) throws MalformedURLException {
    super();
    this.client = new XmlRpcClient(basepath + "/" + getService());
  }
View Full Code Here

   * @param basepath the basepath
   * @throws MalformedURLException
   */
  public AbstractService(String basepath) throws MalformedURLException {
    super();
    this.client = new XmlRpcClient(basepath + "/" + getService());
  }
View Full Code Here

TOP

Related Classes of org.apache.xmlrpc.XmlRpcClient

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.