Question.... xmlrpc query from Code Igniter to aMember to see if a users account exists. $this->load->library('xmlrpc'); $this->xmlrpc->set_debug(TRUE) ; $this->xmlrpc->server('http://localhost/membership/xmlrpc/index.php', 80); $this->xmlrpc->timeout(60); $this->xmlrpc->method('check_uniq_login'); $request = array( array( 'login' => 'test', 'pass' => sha1('password'), 'email' => 'test@test.com', 'check_type' => 2, ),'struct' ); $this->xmlrpc->request($request); if ($this->xmlrpc->send_request()) { echo '<pre>'; print_r($this->xmlrpc->display_response()); echo '</pre>'; } else { echo $this->xmlrpc->display_error(); } I am getting: Did not receive a '200 OK' response from remote server. (HTTP/1.0 401 Unauthorized) Does this look right? I just want to get an initial query to work.
Code Igniter xmlrpc I am trying to see if a users login exists. However, I get: Error #8003 - XML-RPC username is not entered Did not receive a '200 OK' response from remote server. (HTTP/1.0 401 Unauthorized)Array ( ) Anyone have some insight into why this doesn't work. The test account exists under Configuration->Advanced->xmlrpc (enabled, etc) $this->load->library('xmlrpc'); $this->xmlrpc->set_debug(TRUE) ; $this->xmlrpc->server('http://localhost/membership/xmlrpc/index.php', 80); $this->xmlrpc->timeout(60); $this->xmlrpc->method('check_login'); $request = array(array('login' => 'test', 'pass' => sha1('test'),),'struct'); $this->xmlrpc->request($request); if ($this->xmlrpc->send_request()) { echo '<pre>'; print_r($this->xmlrpc->display_response()); echo '</pre>'; } else { echo $this->xmlrpc->display_error(); }
After looking into the aMember code, it appears that $_SERVER['PHP_AUTH_USER'] $_SERVER['PHP_AUTH_PW'] are never set utilizing Code Igniter. At least from digging through the code.
Took a different approach: include_once(dirname(__FILE__) . '/amember/xmlrpc/ixr.inc.php'); $client = new IXR_Client('http://localhost/amember/xmlrpc/index.php'); $client->auth_login = 'test'; $client->auth_pass = 'test'; //get list of all products in aMember $client->query('get_products_list'); $response = $client->getResponse(); echo " "; print_r($response); This works for me with a few minor changes....
These variables are set automatically. have a look: http://www.php.net/manual/en/features.http-auth.php