Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 992609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T06:17:42+00:00 2026-05-16T06:17:42+00:00

I am posting to wordpress in java using xmlrpc successfully using the following code

  • 0

I am posting to wordpress in java using xmlrpc successfully using the following code

    // Hard-coded blog_ID
int blog_ID = 1;

// XML-RPC method
String xmlRpcMethod = "metaWeblog.newPost";

// Create our content struct
...

// You can specify whether or not you want the blog published
// immediately
boolean publish = true;

try {
    XmlRpcClient client = new XmlRpcClient(twtr2wp.xmlRpcUrl, false);

    Object token = client.invoke(xmlRpcMethod, new Object[] {
            new Integer(blog_ID), 
            twtr2wp.wpUsername, 
            twtr2wp.wpPassword,
            hmContent, 
            new Boolean(publish) });

    // The return is a String containing the postID
    System.out.println("Posted : " + token.toString());
} catch (Exception e) {
    e.printStackTrace();
}

Everything is working except for categories. I have seen that they need to be passed in an array but I have not been successful passing them like this:

hmContent.put("categories", "[Cat1,Cat2]");

Can anyone help me figure out why the categories are not showing up?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T06:17:42+00:00Added an answer on May 16, 2026 at 6:17 am

    Just a guess in the dark here, have you tried to put String array instead of [Cat1, Cat2] into the hmContent ?

    Something like this hmContent.put("categories", new String[]{"Cat1", "Cat2"});

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone recommend an xml rpc library or client for wordpress using java? I've
I'm posting on Wordpress using the XMLRPC Api from Redstone . Although the post
Im using wordpress and using the following to get the last 3 most recent
I'm trying to post to WordPress using curl via PHP - I'm posting using
EDIT: Posting full code (except XML as it a bunch of ridiculous table formatting!)
I'm cross-posting this from the wordpress section, b/c I think the problem lies more
My JQuery code is posting, because the success function is firing. The problem is
Wordpress is acting crazy when posting comments, showing a 500 Internal Server Error every
I am using wordpress CMS and when i am post a new post by
I'm using CodeIgniter next to a Wordpress install. So, I've got this site that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.