PHP SoapClient: Function ("hoge") is not a valid method for this service. / SoapServer: Procedure "hoge" not present

SoapClient

$client = new SoapClient("http://www.example.com/soap");
$client->hoge("fuga"); // <-exception occurred!
Exception Message
Function ("hoge") is not a valid method for this service.
but...

SoapServer

Of course, WSDL definitions are correct (Function 'hoge' is added).
$server = new SoapServer("http://www.example.com/soap");
$server->handle(); // <-exception occurred!
Exception Message
Procedure "hoge" not present

set soap.wsdl_cache_enabled to 0.

Add below, Both SoapClient and SoapServer.

SoapClient

ini_set("soap.wsdl_cache_enabled", 0);
$client = new SoapClient("http://www.example.com/soap");
$client->hoge("fuga"); // <-exception occurred!

SoapServer

ini_set("soap.wsdl_cache_enabled", 0);
$server = new SoapServer("http://www.example.com/soap");
$server->handle(); // <-exception occurred!

0 件のコメント:

コメントを投稿