Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 18th, 2012  |  syntax: None  |  size: 1.21 KB  |  hits: 16  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php
  2. set_time_limit(3600);//try running the script for a longer time:S
  3. ini_set(“memory_limit”,”512M”);//err .. tried to increase the memory :S
  4. //phpinfo();
  5. $server_uri = "http://localhost:14003/";
  6. $server_uri1 = "http://localhost:14001/";
  7. require_once('./lib/nusoap.php');
  8. $client = new nusoap_client($server_uri);
  9. $client2 = new nusoap_client($server_uri1);
  10. //$data =  unserialize(file_get_contents("./cache/products.txt"));
  11.  
  12.  
  13.  
  14.  
  15. //retreive the array of product id to pass into the ORders Service!
  16. $productId = $client2 ->call('all',array(),'urn:cset4100:ecommerce:products');
  17.  
  18.  
  19.  
  20. //create an array to hold the
  21. $listProdOrder = array();
  22. //iterate through using
  23. foreach($productId as $num => $product_id )
  24. {
  25.   $orderId= $client ->call('with_product_id',array($product_id),
  26.         'urn:cset4100:ecommerce:orders');
  27.   //get how big the size of the array
  28.   $numofOrders=count($orderId);
  29.   //append the product iD and the number of orders for that order !
  30.   $listProdOrder['$product_id'] =  $numOfOrders;        
  31. }
  32.  
  33. print "Product ID   |   Number of Orders     ";
  34. //print out the listProdOrder array !!
  35. foreach($listProdOrder as $prodID =>$number)
  36. {
  37.    print $prodId."   |  ".$number."\n";
  38. }
  39. ?>