if ($_POST['iso_code']) { // includes nusoap classes include('/www/etc/nusoap/lib/nusoap.php'); // creates an instance of the SOAP client object $wsdl = 'http://geodata.grid.unep.ch/webservices/geodata_roe_ws.php?wsdl'; $client = new nusoapclient($wsdl, 'wsdl'); if ($clientErr = $client -> getError()) { echo 'Error: '.$clientErr; } // view/hide debug messages $client -> debug_flag = true; // Set timeouts, nusoap default is 30 $client -> timeout = 1000; $client -> response_timeout = 1000; // creates a proxy so that WSDL methods can be accessed directly $proxy = $client -> getProxy(); if ($proxyErr = $proxy -> getError()) { echo 'Error: '.$proxyErr; } // parameters $params = array('selectedIDs' => $selectedIDs, 'iso_code' => $iso_code, 'key' => $_POST['key']); // invokes the method $result = $proxy -> DataSearch($params); // the query returned an error if ($soapErr = $proxy -> getError()) { echo 'Error: '.$soapErr; } // the query returned no errors else { $totalResults = $result['TotalResults']; $dataSets = $result['DataSets']; } // parses the result array foreach ($dataSets as $d) { $count++; if ($count % 2 == 0) { $color = "#ccc"; } else { $color = "#fff"; } ?>