Welcome Guest, Not a member yet? Register   Sign In
trying to create an array for XML-RPC = FAIL
#2

[eluser]Nick Husher[/eluser]
You aren't setting a data type for the collection of fields within the loop in the first example:

Code:
$items = array(array(
   'CustomerNo' => array($item->CustomerNo,'string'),
   'CustomerName' => array($item->CustomerName,'string'),
), 'struct');

Here's some code I whipped up a few minutes ago. It seems to work (I can query it with a CI XML-RPC client and it returns the data okay):

Code:
// I have an array of objects named $state, each object in the array
    //has a 'name' and 'shortname' property
    $state_array = array();

    foreach($states as $state) {
        $state_array[] = array(array(
                'name'=> array($state->name,'string'),
                'abbv'=> array($state->shortname,'string')
            ),'struct');
    }
    $response = array($state_array, 'array');
    return $this->xmlrpc->send_response($response);


Messages In This Thread
trying to create an array for XML-RPC = FAIL - by El Forum - 12-02-2008, 05:25 PM
trying to create an array for XML-RPC = FAIL - by El Forum - 12-02-2008, 11:36 PM
trying to create an array for XML-RPC = FAIL - by El Forum - 12-03-2008, 07:56 AM
trying to create an array for XML-RPC = FAIL - by El Forum - 12-03-2008, 09:50 AM
trying to create an array for XML-RPC = FAIL - by El Forum - 12-03-2008, 10:17 AM
trying to create an array for XML-RPC = FAIL - by El Forum - 02-13-2009, 06:37 AM
trying to create an array for XML-RPC = FAIL - by El Forum - 02-24-2009, 02:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB