The php SoapClient __call method is used to call an arbitrary SOAP method. It provides a way to dynamically call any method available in the SOAP server's WSDL file. The syntax of using the __call method is:
$soapClient->__call($methodName, $args);
Where $methodName is the name of the SOAP method to call and $args is an array of method arguments.
Here are some examples of using the __call method:
Example 1: GetWeather
$client = new SoapClient("Weather.wsdl");
$response = $client->__call("GetWeather", array("City" => "New York"));
This code calls the GetWeather method defined in the Weather.wsdl WSDL file with the argument "New York" for the City parameter.
Example 2: GetTime
$client = new SoapClient("Time.wsdl");
$response = $client->__call("GetTime", array());
This code calls the GetTime method defined in the Time.wsdl WSDL file with no arguments.
This code calls the PingServer method defined in the Server.wsdl WSDL file with the argument "myserver.com" for the Server parameter.
The php SoapClient __call method is part of the PHP built-in SoapClient class, which is available in the PHP SOAP extension package.
PHP SoapClient::__Call - 2 examples found. These are the top rated real world PHP examples of SoapClient::__Call extracted from open source projects. You can rate examples to help us improve the quality of examples.