![]() |
XML-RPC from Non-Codeigniter source - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: XML-RPC from Non-Codeigniter source (/showthread.php?tid=8377) |
XML-RPC from Non-Codeigniter source - El Forum - 05-15-2008 [eluser]hotmeteor[/eluser] This may be a very basic practice but I am having a ton of trouble getting XML-RPC to work. Basically, I have a form on one site that I want to send data and process on another site, then return information. I'm assuming I can do this. Can anyone give me a basic example of this (I am using the XMLRPC class, not the native-PHP class). The biggest issue I'm having is not with returning data but with using the data that is sent from the client, ie. how to read the request and pull out data. Anyone? Help? Please?!? XML-RPC from Non-Codeigniter source - El Forum - 05-15-2008 [eluser]gtech[/eluser] are you needing to convert post data to xmlrpc? your requirements are a bit vague.. maybe you could post a cut down version of your client and server, and then someone might be able to help you. XML-RPC from Non-Codeigniter source - El Forum - 05-15-2008 [eluser]hotmeteor[/eluser] Yep, it is post data but it's already been validated and cleaned up so I have put it into a new array. I am able to send the client data (my array) to my server (CI app) but at that point I can't figure out how to pull the variables out. I'm using php_xmlrpc_encode on the client end as well, so maybe there's a problem there? Also, I can send server data back to the client, but it's just the sample data from the User Guide. Hopefully that's a bit more info, but if sample code is necessary I might be able to post some in the morning. XML-RPC from Non-Codeigniter source - El Forum - 05-16-2008 [eluser]gtech[/eluser] its difficult for anyone to see where the problem is without code, but what I would recommend is use something like [url="http://www.wireshark.org/"]wireshark[/url] to see whats being sent to your server.. and then it may help you to be able to decipher how to pull out the XML. its free ![]() XML-RPC from Non-Codeigniter source - El Forum - 05-16-2008 [eluser]hotmeteor[/eluser] Ok, here is my code. Client Code: include('xmlrpc.inc'); Server Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); I want to retrieve the variables from the $req array on my server. How do I do that? XML-RPC from Non-Codeigniter source - El Forum - 05-16-2008 [eluser]gtech[/eluser] Hi i gave your code a go, and found a solution.. you were very close. here is what I did, note the php_xmlrpc_encode was the problem as you thought.. the parameters I passed also gets passed in as an array, so I simply return $pars[0]. hope this helps. Code: <?php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); RESPONSE: Code: <?xml version="1.0" encoding="UTF-8"?> XML-RPC from Non-Codeigniter source - El Forum - 09-29-2008 [eluser]kyko[/eluser] Using wireshark, how did you get the actual xml being sent as request and response? i see the array i passed but not in xml. |