Cook Computing

XML-RPC Structs

January 14, 2003 Written by Charles Cook

Sam Ruby asks:

Does XML RPC permit multiple members of a struct to have the same name?

The XML-RPC spec is silent on this issue but the authors of Programming Web Services with XML-RPC deduce:

The only way duplicate names might be feasible would be if the order of members in an array were significant. Because members are unordered, we may conclude that duplicate names are not permitted, because otherwise there is no deterministic means of interpretation for a struct with a duplicate name.

From a practical point of view we have to assume that duplicates are not allowed because most XML-RPC implementations handle structs using a dictionary or hashtable type of collection.

The book also claims that struct member names must be ASCII but I can't find that requirement in the spec. You are restricted to ASCII in string values but not in struct member names? The ASCII/Unicode issue in XML-RPC really does need sorting out! (Simon Fell agrees.)