soap = new \SoapClient($wsdl, $params); } /** * 属性获取转换 * @param $name * @return string */ public function __get($name) { switch (strtolower($name)) { case 'errmsg': return $this->getError(); case 'errcode': return $this->getErrorCode(); case 'appid': return $this->getAppid(); } return ''; } /** * @param string $name SOAP调用方法名 * @param array|string $arguments SOAP调用参数 * @return array|string|bool * @throws \Exception */ public function __call($name, $arguments) { try { return $this->soap->__call($name, $arguments); } catch (\Exception $e) { Log::error("Soap Error. Call {$name} Method --- " . $e->getMessage()); } return false; } }