Click here to Skip to main content
15,867,686 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have been able to follow the code of blog ping through xml-rpc given as follows :

using System;
using CookComputing.XmlRpc;
 
[XmlRpcMissingMapping(MappingAction.Ignore)]
struct PingResult
{
  public XmlRpcBoolean flerror;
  public string message;
}
  
[XmlRpcUrl("http://rpc.weblogs.com/RPC2")]
interface IWebLogs
{
  [XmlRpcMethod("weblogUpdates.ping")]
  PingResult Ping(string weblog, string url);  
}


IWebLogs proxy = (IWebLogs)XmlRpcProxyGen.Create(typeof(IWeblogs));
PingResult result = proxy.Ping("My Fictitious Blog", "http://www.fictitiousblog.com");
Console.WriteLine("{0} {1}", result.flerror, result.message);


iam trying to make a blog client in c# for desktop (as a gift to someone). But iam stuck as to how ping multiple urls for same blog. Example we specify xmlrpcurl but i want to use many urls instead of just one ( there are many available in wordpress blog).

Could someone please tell me how to do this? I basically want to add urls to the proxy object and then ping them for my updated blog. Any help would be appreciated.
Posted

1 solution

proxy classes are derived from IXmlRpcProxy and so inherit a Url property. This means that the XmlRpcUrl attribute can be omitted from the definition of the proxy class and instead the Url property is then set on an instance of the proxy class:

C#
using System;
using CookComputing.XmlRpc;
 
[XmlRpcMissingMapping(MappingAction.Ignore)]
struct PingResult
{
  public XmlRpcBoolean flerror;
  public string message;
}
  
interface IWebLogs : IXmlRpcProxy
{
  [XmlRpcMethod("weblogUpdates.ping")]
  PingResult Ping(string weblog, string url);  
}

IWebLogs proxy = (IWebLogs)XmlRpcProxyGen.Create(typeof(IWebLogs));
proxy.Url = "this is a var";
PingResult result = proxy.Ping("My Fictitious Blog", "http://www.fictitiousblog.com");
Console.WriteLine("{0} {1}", result.flerror, result.message);
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900