<div dir="ltr"><div>Hello,<br></div><div><br></div><div>Don't know if anyone has asked this before, since the mailing list archive spans a long time, it's just easier for me to re-ask if asked before.</div><div><br>
</div><div>I'm working on a XML-RPC service that reflects any given PHP class. One XML-RPC method takes any number of arguments from the XML-RPC request/call.</div><div><br></div><div>In the XML-RPC method, I then store all the arguments into a PHP array of xmlrpcvals, via iterating over xmlrpcmsg->getParam(n) for the total # of params based on getNumParams().</div>
<div><br></div><div>I would then like to dynamically/abstractly handle converting each element of that xmlrpcval array into its PHP object equivalent, where the element may be a scalar, array, or struct (generally scalar or array). And that array may contain yet more scalars, arrays, or structs (though for simple case most likely scalars).</div>
<div><br></div><div>How might I recursively and/or iteratively parse the xmlrpcval array into it's PHP equivalent in a way that handles all cases? Since we don't know until runtime (i.e. when XML-RPC call is made) what the exact arguments are (type and number of them).</div>
<div><br></div><div>Has anyone done something similar before? I've done similar for other language platforms but those libraries did more implicit conversion handling for me, so I didn't have to go into this level of detail as with this PHP library.</div>
<div><br></div><div>I'm planning to try to work something out when I have time, and in the meantime, handle the simple case for now where the array will always be of scalars (not array within array), and ignore structs. And wanted to see what feedback/tips I can get from the community, hence this email.</div>
<div><br></div><div>Regards,</div><div>David</div></div>