XML-RPC ... sending a query result back as a result |
[eluser]skattabrain[/eluser]
I'm probably missing something basic here, but I'm trying to send a query result back as a response from my xml-rpc server. 1 row is not a problem ... but if I wanted to send back ... say a list of my customers orders ... I'm having trouble. Maybe the problem is I don't understand struct ... but here is my code, the client will then take the response and loop through it to generate an order list. The server is using ODBC instead of the typical MySQL query ... but I doub tthis is the issue I'm having. Any thoughts? I'm majorly frustrated with this ... Code: function customerlist($request)
[eluser]Nick Husher[/eluser]
What is your server response when you visit http://yourhost.com/yourcontroller/customerlist ? Also, as a stylistic suggestion, I'd define the $results object before you start using it. Code: $results = array();
[eluser]skattabrain[/eluser]
here's the response fucntion ... Code: function customerlist($request) here's what the XML the client outputs (with debugging on) this error spirals into a pile of php errors with libraries/Xmlrpc.php <h4>A PHP Error was encountered</h4> <p>Severity: Notice</p> <p>Message: Undefined offset: 0</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1345</p> Code: <?xml version="1.0" encoding="UTF-8"?> The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further.
[eluser]skattabrain[/eluser]
I'm just not building my array correctly ... this has to be a simple
[eluser]Michael Wales[/eluser]
Maybe I'm just not understanding the issue here... Code: function customerlist($request) {
[eluser]skattabrain[/eluser]
I see I've managed to rouse the elders Thanks Michael ... but that's not working either ... here's my debug. It could be the fact that this is ODBC and not Active Record? This blasted Windows Server and it's proprietary flat file database/ODBC has been a nuisance. Code: ---DATA---
[eluser]skattabrain[/eluser]
my request ... Code: function customerlist() my server ... Code: class Get_customer extends Controller {
[eluser]skattabrain[/eluser]
here is what the ODBC $query looks like (var_dump) Code: object(CI_DB_odbc_result)#12 (7) { In order to use it in a normal controller/view scenrio it's same there anyways... Code: echo '<ul>';
[eluser]skattabrain[/eluser]
Any ideas? I need to get this accomplished today. Any assistance is appreciated.
[eluser]skattabrain[/eluser]
Here is where I'm at ... I have no idea what is wrong with the array I'm building here (building it because I'm no sure sure the ODBC query is the expected format for XML-RPC. Code: $query = $this->db->query("SELECT * FROM AR_Customer"); Generates this error (shown from the client with debugging on) The XML data receieved was either invalid or not in the correct form for XML-RPC. Turn on debugging to examine the XML data further. Code: ---DATA--- etc ... |
Welcome Guest, Not a member yet? Register Sign In |