divan/gorilla-xmlrpc

The XML-RPC request parameter doesn't accept, If there is no <string> tag in the <value> tag,

Opened this issue · 2 comments

eastwd commented

I sent the xml-rpc request like this, but xml-rpc server doesn't get the request value.

<?xml version="1.0"?><methodCall><methodName>MethodName</methodName><params><param><value><struct><member><name>ParamName</name><value>ParamValue</value></member></struct></value></param></params></methodCall>

I think it caused for the following reasons

If there are no type in the tag, val doesn't set because value.Array is empty.
https://github.com/divan/gorilla-xmlrpc/blob/master/xml/xml2rpc.go#L154-L155

and, we can not reach this code.
https://github.com/divan/gorilla-xmlrpc/blob/master/xml/xml2rpc.go#L157-L163

Got the same issue, there is no string tag inside the value so it parse an empty string. Did you find a workaround?

I removed this line, and it works fine.

case len(value.Array) == 0:
val = val