![]() |
XML-RPC Help sending data... - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: XML-RPC Help sending data... (/showthread.php?tid=19788) |
XML-RPC Help sending data... - El Forum - 06-18-2009 [eluser]the1rob[/eluser] Ok, I've been chewing on this for a while, with no success. I went through all the documentation I could find...I even went through these forums. My problem is this: I set up a xmlrpc server. Now I want to send data to it. The client and server talk to each other fine...I can pass a method with no problem. The issue is when I try to populate the parameters... Code: $request = array( Once I hit the send_request I get a bunch of PHP errors: A PHP Error was encountered Severity: Notice Message: Undefined offset: 0 Filename: libraries/Xmlrpc.php Line Number: 627 I get 4 of those, then... Fatal error: Call to a member function serialize_class() on a non-object in /home/srwww/system/libraries/Xmlrpc.php on line 646 Sooo...something is wrong with my $request array. Can someone, ANYONE, please take a look and nudge me in the right direction? I'm dying here. -t1r XML-RPC Help sending data... - El Forum - 06-18-2009 [eluser]gtech[/eluser] I seem to rememeber (I havn't touched xml for about a year) that if you have an array in the XML request you need to have the keyword 'struct'. example: Code: $this->xmlrpc->request(array( XML-RPC Help sending data... - El Forum - 06-18-2009 [eluser]gtech[/eluser] [url="http://ellislab.com/forums/viewthread/81915/"] This thread I posted just over a year ago should help [/url] edit: I havn't tested it.. but I think you want somthing like this: Code: $this->xmlrpc->request(array( the server might be somthing like: Code: function _process($request) the XMLRPC code uses an array to build up the request and the last element in the array tells the xml code what type of variable is contained in the array. for example a string: Code: array('data','string') Code: array(array('data','string'),array('data2','string'),'struct') XML-RPC Help sending data... - El Forum - 06-18-2009 [eluser]the1rob[/eluser] Holy crap that last trick worked! Posting the code for future searches... Client side: Code: $request = array( Server side: Code: $parameters = $request->output_parameters(); Worked perfectly! Server grabbed it and processed it perfectly on the first shot! Woohoo! Thank you! XML-RPC Help sending data... - El Forum - 06-18-2009 [eluser]gtech[/eluser] cool.. I love it when a plan comes together.. I remember it took me a while to figure out how to send arrays and assosiative arrays through XMLRPC so glad to save you the stress. |