Skip to content

Commit

Permalink
Fix 2 problems when interfacing with C sharp.
Browse files Browse the repository at this point in the history
- i8 type
- Int values should be typed in xml.
  • Loading branch information
Jerome Maloberti committed Mar 19, 2012
1 parent d39587a commit ad455e9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/xmlrpc.ml
Expand Up @@ -61,9 +61,9 @@ let rec add_value f = function
f "<value><nil/></value>"

| Int i ->
f "<value>";
f "<value><int>";
f (Int64.to_string i);
f "</value>"
f "</int></value>"

| Bool b ->
f "<value><boolean>";
Expand Down Expand Up @@ -317,6 +317,7 @@ module Parser = struct

and basic_types ?callback accu input = function
| "int"
| "i8"
| "i4" -> make_int ?callback accu (get_data input)
| "boolean"-> make_bool ?callback accu (get_data input)
| "double" -> make_float ?callback accu (get_data input)
Expand All @@ -325,7 +326,7 @@ module Parser = struct
| "array" -> make_enum ?callback accu (data (of_xmls ?callback accu) input)
| "struct" -> make_dict ?callback accu (members (fun name -> of_xml ?callback (name::accu)) input)
| "nil" -> make_null ?callback accu ()
| tag -> parse_error (sprintf "open_tag(%s)" tag) "open_tag(int/i4/boolean/double/string/dateTime.iso8601/array/struct/nil)" input
| tag -> parse_error (sprintf "open_tag(%s)" tag) "open_tag(int/i8/i4/boolean/double/string/dateTime.iso8601/array/struct/nil)" input

and of_xmls ?callback accu input =
let r = ref [] in
Expand Down

0 comments on commit ad455e9

Please sign in to comment.