batch/1.1/old/soapClient.php
2012-10-16 07:44:31 +00:00

39 lines
1.3 KiB
PHP

#!/usr/bin/php -c/var/www/batch/config/php_batch_sd.ini
<?
error_reporting(E_ALL);
ini_set('soap.wsdl_cache_enabled', 0);
// Nouveau Client SOAP
//$client = new SoapClient('http://classes.scriptsphp.org/webservice.wsdl', array('trace' => 1,'soap_version' => SOAP_1_1));
$client = new SoapClient('http://sd-4213.dedibox.fr/ws/asso/asso.wsdl', array( 'trace' => 1, 'soap_version' => SOAP_1_1,
'login' => 'TESTASSOSYSPERTEC', 'password' => 'TESTPW'));
//$client = new SoapClient(null, array('location' => "http://sd-4213.dedibox.fr/ws/asso",
// 'uri' => "http://test-uri/", 'login' => 'TESTASSOSYSPERTEC', 'password' => 'TESTPW'));
$argv=$_SERVER['argv'];
unset($argv[0]);
try {
// $O = $client -> __call('searchScript', array('search'=> implode(' ', $argv) ));
// $O = $client -> __call('rechercheAsso', array('nom'=>'LOAR GANN', 'adresse'=>'QUIMPER'));
$O = $client->rechercheAsso(implode(' ', $argv));
// $O = $client->identiteAsso($argv[1]);
print_r($O);
die();
print_r($O->results);
foreach ( $O->results as $val ) {
echo (string)$val->title .EOL;
echo 'Url : '. $val->url .EOL;
echo utf8_decode($val->summary).EOL.EOL;
}
} catch (SoapFault $fault) {
echo 'ERREUR SOAP :'.EOL;
print_r($fault);
}
die();
?>