Skip to main content

parse_method_call

Function parse_method_call 

Source
pub fn parse_method_call(xml: &str) -> Result<MethodCall>
Expand description

Parse an XML-RPC <methodCall>.

The previous implementation pushed XmlRpcValue::String(text) for every text node and never looked at the type element, so <int>5</int> reached the model as "5" and six of the ten XmlRpcValue variants were unreachable. It also collected array elements only at </data> (keeping just the last one and leaking the rest into the next parameter), dropped parameters whose value was empty (shifting every later parameter down one position), and returned Ok(MethodCall { method_name: "", .. }) for input that was not XML-RPC at all.

This version tracks the active type element, closes each value at </value>, and validates the document shape.

Public for fuzz/fuzz_targets/xmlrpc_value.rs, which hands whatever this accepts to actions::create_method_call_event exactly as the request path does.