When I try to access a function in wsdl with some data(using soap client in php) I am getting the following error.
Uncaught SoapFault exception: [Client] Function function_nameis not a valid method for this service
Any help?
When I try to access a function in wsdl with some data(using soap client in php) I am getting the following error.
Uncaught SoapFault exception: [Client] Function function_nameis not a valid method for this service
Any help?
If you want to execute a function that SOAP can not find - it is possible that PHP cached the wsdl file.
Add this:
ini_set("soap.wsdl_cache_enabled", "0");
to disable the caching.
Two possible solutions :
I had this problem and finally decided to check my php error log.
In php.ini enable always_populate_raw_post_data = -1
and restart the server .
My PHP version is 5.6.8
Just add Parameters,Return type and Method of web service in comments at the top of the function. It will work. I tried its working.
/**
* @param string the symbol of the stock
* @return float the stock price
* @soap
*/
public function getPrice($symbol)
{
//...return stock price for $symbol
}
In our situation this exception occurred when upgrading from PHP5.6 to PHP7. For us disabling the WSDL cache did also work.
ini_set("soap.wsdl_cache_enabled", "0");
Also see: http://lornajane.net/posts/2015/soapfault-when-switching-php-versions