PHP SOAP Client
PHP SOAP Client PDF Print E-mail
Written by Mickael Cabanas   
Friday, 20 January 2012 21:36

This is how to use PHP SOAP Client for SOA For VM.

This sample code is for calling "GetProductsFromCategory" Method in VM_ProductService.


$catid = $_POST['catid']; 
	
	$client = new SoapClient("http://YOUR_URL/administrator/components/
        com_vm_soa/services/VM_ProductWSDL.php");
	
	$loginInfo['login']="admin";
	$loginInfo['password']="yourPass";
	
	$params['loginInfo']=$loginInfo;
	$params['catgory_id']=$catid;
        $params['product_publish']="Y";
        $params['with_childs']="Y";

	
	$productarray = array($client->GetProductsFromCategory($params));
	
	$count = count($productarray[0]);
	
	for ($idx=0 ; $idx<$count ; $idx++){
			
		
                $prod = (object)$productarray[0]->Produit[$idx];
		
		print($prod->nom);
		print($prod->prix);
		print($prod->discount);
		print($prod->discount_is_percent);
		print($prod->description);
		print($prod->image);
		...
	
	}

Note that you need PHP SOAP Module enabled on your server

Last Updated on Friday, 10 February 2012 13:02
 

Follow us on Facebook & Twitter



  

Useful informations

Itunes / Online store / Forum / FAQS / Contacts / About Us / Terms of Service