简体   繁体   English

如何使用XML-RPC.NET返回多个参数?

[英]How I return multiple parameters using XML-RPC.NET?

I am implementing in ASP.NET custom server protocol in XML RPC due to specification. 由于规范,我正在XML RPC中的ASP.NET自定义服务器协议中实现。 I use library XML-RPC.NET. 我使用XML-RPC.NET库。

I got stuck on one method, because the specification of the custom protocol says that the method X has two output parameters (integer and boolen). 我受困于一种方法,因为自定义协议的规范说方法X有两个输出参数(整数和布尔值)。 How can I do that using C# and XML-RPC.NET? 如何使用C#和XML-RPC.NET做到这一点?

I answer my own question after long time. 很久以后,我回答了自己的问题。 There are two possibilities. 有两种可能性。

  1. return special type XmlRpcStruct (http://xmlrpc.sourceforge.net/javadoc/redstone/xmlrpc/XmlRpcStruct.html) 返回特殊类型的XmlRpcStruct(http://xmlrpc.sourceforge.net/javadoc/redstone/xmlrpc/XmlRpcStruct.html)

  2. return Struct which have properties names like param names. 返回具有属性名称(如参数名称)的Struct。

An XML-RPC response only has a single <param> return value. XML-RPC响应只有一个<param>返回值。 To return two values, as in your case, the return value would have to be a struct or array value. 要返回两个值(如您的情况),返回值必须是结构或数组值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM