I'm using the PHP
native class to create a Soap server.
Example:
class Bar {
public function getDrink($age, $money, $name) {
if ($age >= 18 && $money == 5):
$drink = "Heineken";
else:
$drink = "water";
endif;
if (empty($name)): // name é um parametro opcional.
$name = "Hey ";
endif;
return $name . " here is your " . $drink;
}
}
$options = array('uri' => 'http://localhost/webservice');
$server = new SoapServer(NULL, $options);
$server->setClass('Bar');
$server->handle();
Then I can consume all methods of class Bar
in my SoapClient, however all parameters become mandatory. how could I specify to the server that some parameters of a particular method will be optional?