XML-RPC ... sending a query result back as a result |
[eluser]Nick Husher[/eluser]
Code: $query = $this->db->query("SELECT * FROM AR_Customer"); The issue here is that you're assigning a type of Array, but the data that you are sending is not contiguously indexed. For example, if you have customer numbers of [0,3,9,41,42,43,121], your array will look like [0=>"Customer 0", 1=>undefined, 2=>undefined ... 9=>"Customer 9" ...]. When the loop that's cycling over your array gets to index 1, it dies, becuase index 1 is undefined. You can find the relevant code in your CI project under /system/libraries/Xmlrpc.php on line 1341. Here's what it looks like: Code: // array You can see that it's doing a linear iteration of your array, which will fail if your indexes aren't contiguous.
[eluser]skattabrain[/eluser]
Hmmm, if I understood you correctly ... using a simple counter starting at zero for $myarray is all I really need to do. That's failing too ... Code: $query = $this->db->query("SELECT * FROM AR_Customer"); returns ... [code] ---DATA--- HTTP/1.1 200 OK Date: Tue, 02 Dec 2008 16:48:30 GMT Server: Apache/2.2.8 (Win32) PHP/5.2.6 X-Powered-By: PHP/5.2.6 Connection: close Content-Type: text/html <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP Error was encountered</h4> <p>Severity: Warning</p> <p>Message: htmlspecialchars() expects parameter 1 to be string, array given</p> <p>Filename: libraries/Xmlrpc.php</p> <p>Line Number: 1360</p> </div><div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> on and on .... <?xml version="1.0" encoding="UTF-8"?> <methodResponse> <params> <param> <value> <array> <data> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> <value> </value> </data> </array> </value> <value> <array> <data> <value> </value> etc.... 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]Nick Husher[/eluser]
I think your inner loop isn't defining a data type. It's attempting to typecast your array into a string and failing. Code: $query = $this->db->query("SELECT * FROM AR_Customer");
[eluser]skattabrain[/eluser]
Hmmm ... thanks Nick, still not working, but the data is passing through ... i removed customer names in this result ... Code: ---DATA---
[eluser]Nick Husher[/eluser]
What's the tail end of your xmlrpc look like? The whole thing should look like a very long version of this: Code: <?xml version="1.0" encoding="UTF-8"?>
[eluser]skattabrain[/eluser]
Code: <string>Evelyn Mak</string>
[eluser]skattabrain[/eluser]
it's too large to post complete ... and LIMIT isn't working on this ODBC query.
[eluser]skattabrain[/eluser]
moved the big question here - http://ellislab.com/forums/viewthread/98676/ |
Welcome Guest, Not a member yet? Register Sign In |