• I am trying to get WordPress categories using the XML-RPC method and it’s working fine on my local as well as sandbox environment but not on production. I am using c# for the same and here is the code.

    public JsonArray GetCateg(string username, string password){
     IgetCatList categories = (IgetCatList)XmlRpcProxyGen.Create(typeof(IgetCatList));
     XmlRpcClientProtocol clientProtocol = (XmlRpcClientProtocol)categories;
     //clientProtocol.Url = "https://samplewebsite12399.wordpress.com" + "/xmlrpc.php";
     clientProtocol.Url = url + "/xmlrpc.php";
     if (hasServiceUnavailable)
        clientProtocol.UserAgent = "WordPress XML-RPC Client/1.1";
        clientProtocol.KeepAlive = true;
        clientProtocol.Timeout = 42000;
      try
      {
    
         Category[] wpCategories = categories.GetCategories(1, username, password);
          return wpCategories;
      }
      catch(Exception ex){
    
      }
    }
    
    public interface IgetCatList
    {
      [XmlRpcMethod("metaWeblog.getCategories")]
      Category[] GetCategories(int blog_id, string username, string password);
    }

    I am getting this error

    {“message”:”Conflict”,”stacktrace”:” at xmlrpc.XmlRpcClientProtocol.ReadResponse(XmlRpcRequest req, WebResponse webResp, Stream respStm)\r\n at xmlrpc.XmlRpcClientProtocol.Invoke(Object clientObj, MethodInfo mi, Object[] parameters)\r\n at xmlrpc.XmlRpcClientProtocol.Invoke(MethodInfo mi, Object[] Parameters)\r\n at XmlRpcProxy9144647b-28c2-4d11-9ab9-35cd3f53ba20.GetCategories(Int32 blog_id, String username, String password)}?

    The page I need help with: [log in to see the link]

  • The topic ‘Wordress Get All Categories using xmlrpc is not working’ is closed to new replies.