C#> XML-RPC.NET> Python 邮递员
我正在尝试使用 .NET Web 应用程序来管理在 Python 中运行的外部 MailMan 服务器。我已经建立并运行了连接,并且所有基本功能都可以正常运行。剩下的最后一个问题是找到 Python 键/值对列表的 .NET 等效数据类型。
我无法访问 MailMan 服务器的内部运作,我只收到来自 XML 响应的异常。
字典<字符串,对象>
System.Collections.Generic.Dictionary`2[System.String,System.Object] 无法映射到 XML-RPC 类型
字符串[,]
Message=服务器返回错误异常:[-32500]“list”对象没有属性“keys”
string
Message=服务器返回错误异常:[-32500]“str”对象没有属性“keys”
KeyValuePair
Message=服务器返回错误异常:[-32500] 属性“Value”被忽略
是否有我可能缺少但没有想到的数据类型,或者有任何其他解决方法?我曾考虑过手动形成 XML 的该部分,但由于不知道它应该是什么样子,所以我不知道如何编写/格式化它。
I am attempting to use a .NET web application to manage an external MailMan server running in Python. I have the connection up and running, and all the basic functionality working completely. The last issue remaining is to find .NET's equivalent data type for a Python Key/Value pair list.
I have no access to the inner workings of the MailMan server, I only receive the exceptions from the XML response.
Dictionary<string, object>
System.Collections.Generic.Dictionary`2[System.String,System.Object]
which cannot be mapped to an XML-RPC
type
string[,]
Message=Server returned a fault exception: [-32500] 'list' object has no attribute 'keys'
string
Message=Server returned a fault exception: [-32500] 'str' object has no attribute 'keys'
KeyValuePair<string, object>
Message=Server returned a fault exception: [-32500] attribute "Value" ignored
Are there any data types I may be missing that I have not thought of, or any other work around? I have thought of manually forming that portion of the XML, but with no idea of how it should look, I am at a loss for how I would write/format it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在此处查看 XML-RPC 规范:
http://www.xmlrpc.com/spec1
该规范详细介绍了 XML-RPC 的不同负载。其中之一是“结构”,这可能就是您正在寻找的。它可以包含成员,而成员又包含名称/值对。
如果您使用的是 XML-RPC.NET,则可以查看 XML-RPC.NET 常见问题解答以了解 XML-RPC 结构如何映射到 .NET 类型:
http://www.xml-rpc.net/faq/xmlrpcnetfaq-2-5-0.html#1.10< /a>2
它看起来像一个 XML -RPC结构可以映射到.NET结构或类。
不确定这是否有帮助,但这些是我在处理 XML-RPC 时使用的资源。
You can view the XML-RPC specs here:
http://www.xmlrpc.com/spec1
The spec details the different payloads for XML-RPC. One of them is "struct," which may be what you are looking for. It can contain members, which in turn contain a name/value pair.
If you are using XML-RPC.NET, you can then look at the XML-RPC.NET faq to see how an XML-RPC Struct maps to a .NET type:
http://www.xml-rpc.net/faq/xmlrpcnetfaq-2-5-0.html#1.102
It looks like an XML-RPC struct can be mapped to a .NET struct or class.
Not sure if this helps, but these are the resources I used when dealing with XML-RPC.