I'm developing a XML-RPC service in C# using the XML-RPC.NET library. The service will be used to expose a forum to Tapatalk users
The Tapatalk API documentation states which methods should be implemented. Sometimes a parameter is specified as optional.
E.g. get_topic
has 4 parameters: forum_id
, start_num
, last_num
and mode
The method is invoked by the Tapatalk app with either all parameters or only the first 3 (so mode
is omitted).
I defined the methods as follows:
[XmlRpcMethod("get_topic"]
public GetTopicResult GetTopic(string forum_id, int? start_num, int? last_num, string mode)
When the method is invoked with all 4 parameters specified all goes well. When mode
is omitted I get the following error: Request contains too few param elements based on method signature.
Specifing mode as an optional parameter doesn't seem to do the trick:
[XmlRpcMethod("get_topic"]
public GetTopicResult GetTopic(string forum_id, int? start_num, int? last_num, string mode = "")
Trying to overload the method results in this error: Method GetTopic in type Mobiquo has duplicate XmlRpc method name get_topic
[XmlRpcMethod("get_topic"]
public GetTopicResult GetTopic(string forum_id, int? start_num, int? last_num)
[XmlRpcMethod("get_topic"]
public GetTopicResult GetTopic(string forum_id, int? start_num, int? last_num, string mode)
Any idea how I specify a parameter as optional?
Niels