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 6851111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:12:29+00:00 2026-05-27T01:12:29+00:00

Im trying to to write a program in C# and I’m stuck. The program

  • 0

Im trying to to write a program in C# and I’m stuck. The program suppose to create a post on wordpress via xmlrpc. I can create the post successfully but I have problems creating custom fields for the post. So when I open created post, custom fields are never there. I hope some of you gurus can help me as I am stuck for 3 days now and cant figure out what to do, feel absolutely helpless:(

Heres some code:

public struct customField
        {
            public string key;
            public string value; 
        }
        public struct newPost
        {
            public string[] categories;
            public string title;
            public string description;
            public string mt_excerpt;
            public customField[] cf;
        }
public interface IcreatePost
       {
           [CookComputing.XmlRpc.XmlRpcMethod("metaWeblog.newPost")]
           string NewPost(int blogId, string strUserName,
               string strPassword, newPost content, int publish);
       }

Heres how I set values for the object

    customField newCustomField2 = default(customField);

    newCustomField2.key = "some data";

    newCustomField2.value = "some data";


    newPost newBlogPost = default(newPost);
    newBlogPost.title = "Some Title";
    newBlogPost.description = "Some Content";
    newBlogPost.cf = new customField[] { newCustomField2 };
createPost(newBlogPost);

Function called:

public void createPost(newPost np)
        {

            string postid;
            icp = (IcreatePost)XmlRpcProxyGen.Create(typeof(IcreatePost));
            clientProtocol = (XmlRpcClientProtocol)icp;
            clientProtocol.Url = "http://127.0.0.1/xmlrpc.php";
            try
            {
                postid = icp.NewPost(1, "admin", "1234", np, 1); 

            }
            catch (Exception ex)
            {
                MessageBox.Show("createPost ERROR ->"+ ex.Message);
            }
        }
  • 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-27T01:12:29+00:00Added an answer on May 27, 2026 at 1:12 am

    My only guess here would be that there is a naming mismatch in your parameters. The documentation that I’ve seen says that the field inside the newPost struct should be custom_fields rather than cf:

    public struct newPost
    {
        public string[] categories;
        public string title;
        public string description;
        public string mt_excerpt;
        public customField[] custom_fields;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a program that can password protect individual folders, but I'm
I am trying to write a program using python-fuse, but I can't get file
Im trying to write a program to read a text file through args but
I'm trying to write a program to automate a ticket draft. We have a
I am trying to write a program in java where in i can find
I'm trying to write a program that outputs data that can be served over
I am trying to write a program to simulate a card game. I have
I am trying to write a program that will output via coordinates. I am
I'm trying to write a program to calculate triangles. Can anyone give me a
I am trying to write a program that can replace text and replace also

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.