
Untitled
By: a guest on
May 18th, 2012 | syntax:
None | size: 1.21 KB | hits: 16 | expires: Never
<?php
set_time_limit(3600);//try running the script for a longer time:S
ini_set(“memory_limit”,”512M”);//err .. tried to increase the memory :S
//phpinfo();
$server_uri = "http://localhost:14003/";
$server_uri1 = "http://localhost:14001/";
require_once('./lib/nusoap.php');
$client = new nusoap_client($server_uri);
$client2 = new nusoap_client($server_uri1);
//$data = unserialize(file_get_contents("./cache/products.txt"));
//retreive the array of product id to pass into the ORders Service!
$productId = $client2 ->call('all',array(),'urn:cset4100:ecommerce:products');
//create an array to hold the
$listProdOrder = array();
//iterate through using
foreach($productId as $num => $product_id )
{
$orderId= $client ->call('with_product_id',array($product_id),
'urn:cset4100:ecommerce:orders');
//get how big the size of the array
$numofOrders=count($orderId);
//append the product iD and the number of orders for that order !
$listProdOrder['$product_id'] = $numOfOrders;
}
print "Product ID | Number of Orders ";
//print out the listProdOrder array !!
foreach($listProdOrder as $prodID =>$number)
{
print $prodId." | ".$number."\n";
}
?>