Cook Computing

As part of continuing testing,

January 29, 2002 Written by Charles Cook

As part of continuing testing, last night I implemented an XML-RPC.NET proxy class for the Blogger API. As well as throwing up a bug in deserializing of arrays (when retrieving the type of an array element from the array type an assembly qualified name must be passed to GetType if the type is defined in a different asembly), this also raised the issue of more flexiblity in mapping .NET struct types to/from XML-RPC structs. I defined


public struct UserBlog
{
  public string blogID;
  public string blogName;
  public string Url;
}

and, of course, when making a call to getUsersBlogs only the blogName had a value in the returned array of UserBlog's - because the names of the first and last members should be "blogid" and "url". Off the top of my head I can't remember what the XML-RPC spec says about naming of struct members but it could be useful to be able to map .NET struct members to XML-RPC struct members in the same way as the XmlRpcMethod attribute does for methods. So in this example I could have done something like this (ok, its a feeble example):


public struct UserBlog
{
  XmlRpcStructMember["blogid"]
  public string blogID;
  public string blogName;
  XmlRpcStructMember["url"]
  public string Url;
}

I'll include the Blogger API proxy class in the next release of XML-RPC.NET.