<?PHP
#filename index.php PHP 5.3.3
#https://bugs.php.net/bug.php?id=41631
//SERVER CODE
// server
class MySoapServer{
public function getMessage(){
return 'Hello,World!';
}
public function addNumbers($num1,$num2){
sleep(200);
return $num1+$num2;
}
}
$options= array('uri'=>'https://localhost/test');
$server=new SoapServer(NULL,$options);
$server->setClass('MySoapServer');
$server->handle();
?>
<?PHP
#PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57)
#Copyright (c) 1997-2010 The PHP Group
#Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
#with Xdebug v2.1.4, Copyright (c) 2002-2012, by Derick Rethans
// client
$options= array(
'uri' => 'https://localhsot/',
'location' => 'https://localhost/',
'connection_timeout' => 30,
);
ini_set('default_socket_timeout',20);
file_put_contents('/tmp/ini.txt',print_r(ini_get_all(),true)."\n",FILE_APPEND);
$start = time();
$client = new SoapClient(NULL,$options);
echo $client->getMessage()."\n"; //Hello,World!
$end = time();
echo "runtime : " .($end - $start). "\n";
echo $client->addNumbers(3,5)."\n"; // 8
$end = time();
echo "runtime : " .($end - $start) ."\n";
?>