How to we use the SoapClient in Cakephp…?

前端 未结 1 1652
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-12 21:21

I have enabled SOAP in my local server. My code is:

ini_set(\'soap.wsdl_cache_enabled\', \'0\'); 
ini_set(\'soap.wsdl_cache_ttl\', \'0\'); 
$client = new Soa         


        
相关标签:
1条回答
  • 2021-01-12 21:59

    You're in a different namespace, and SoapClient is in the root namespace, so use \SoapClient:

    $client = new \SoapClient('web_url');
    

    Alternatively, near the namespace declaration make a use statement:

    namespace App\Controller
    use SoapClient;
    

    Note: this isn't a CakePHP specific problem, it's a general namespace issue.

    0 讨论(0)
提交回复
热议问题