[eluser]socs[/eluser]
I'm new to using XML RPC and trying to get it to work but seems the response is not in an XML format.
Here's my code and when my client calls my server I get the following response below...
Code:
function getTest($request)
{
$parameters = $request->output_parameters();
$site = 0; //US
$per_page = 20; // limit
$cur_page = 0;
$adslist = array();
$this->db->where('siteid', $site);
$query = $this->db->get('ad', $per_page, $cur_page);
$count = 0;
$arraymap = array();
foreach($query->result() as $row){
$arraymap[$count] = array(
array(
'title'=> array($row->title,'string'), //TODO cdata and html strip
'id'=> array($row->id,'string'),
'price'=> array($row->price,'string'),
),'struct');
$count = $count + 1;
}
$response = array(
array('total' => array($count,'string'),
'category' => array($category, 'string'),
'items' => array($arraymap, 'array'),
),
'struct');
return $this->xmlrpc->send_response($response);
}
And here's the response. Shouldn't this be in xml format ?
2/10/09 10:59:55 AM ListBiteTicket[4274] result:{
category = 0;
items = (
{
id = 6836;
price = "180.00";
title = "Tiny Yorkie puppies Available !!";
},
{
id = 6837;
price = "0.00";
title = " Affectionate Yorkie Puppies For Adoption ";
},
{
id = 6843;
price = "0.00";
title = "Teacup size yorkies,maltese & chihuahua on sale";
},
{
id = 6844;
price = "400.00";
title = "excellent english bulldog for free adoption";
},
{
id = 10135;
price = "0.00";
title = "Free Tea Cup Yorkie Puppies For Adoption ";
},
{
id = 10136;
price = "0.00";
title = "Free Tea Cup Yorkie Puppies For Adoption ";
},
{
id = 6833;
price = "400.00";
title = "CUTE MALE AND FEMALE BABY CAPUCHIN MONKEYS FOR ADOPTION ";
},
{
id = 6839;
price = "1.00";
title = " Hiring Ad Paste ";
},
{
id = 6852;
price = "0.00";
title = "Hiring Ad Paste \"basit09\"";
},
{
id = 6847;
price = "1.00";
title = "Hiring Ad Paste \"hannibal13\"";
},
{
id = 6846;
price = "0.00";
title = "The Day The Towers Fell ";
},
{
id = 6838;
price = "10.00";
title = "Revenge Denied";
},
{
id = 6840;
price = "0.00";
title = " Hiring Ad Paste ?Arshad28?";
},
{
id = 6848;
price = "19.95";
title = "The Joy of Being ";
},
{
id = 10138;
price = "24.95";
title = "Sinking the Ship of State (Book) ";
},
{
id = 1027;
price = "0.00";
title = "On Vacation";
},
{
id = 6317;
price = "0.00";
title = "Short Term Vacation Rentals In Jerusalem ";
},
{
id = 6320;
price = "0.00";
title = "South Lake Tahoe Vacation Home";
},
{
id = 6332;
price = "0.00";
title = "Hillcrest Guest House, US Virgin Islands";
},
{
id = 6333;
price = "0.00";
title = "Hillcrest Guest House, US Virgin Islands";
}
);
total = 20;
}