C# > XML-RPC.NET > Python MailMan
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.
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.
精彩评论