Question

If I try with below code,

<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Live_stock extends CI_Controller {

    public function index()
    {
        //$this->load->view("live_stock_view");

        $proxy = new SoapClient('www.abc.com/api/v2_soap/?wsdl'); // TODO : change url
        $sessionId = $proxy->login('abc', 'abc123'); // TODO : change login and pwd if necessary
        $result = $proxy->catalogProductList($sessionId);
        var_dump($result);

    }
}

My output :

enter image description here

How to solve my error?

Was it helpful?

Solution

Solved. (CodeIgniter)

$proxy = new SoapClient('abc.com/api/v2_soap/?wsdl=1'); 
$sessionId = $proxy->login((object)array('username' => 'abc', 'apiKey' => 'abc123'));
$result = $proxy->catalogProductList((object)array('sessionId' => $sessionId->result, 
'filters' => null));        
return $result->result();
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top