config('hisservice.his_soap.url'), SoapClientInterface::WSDL_LOCATION => config('hisservice.his_soap.location'), SoapClientInterface::WSDL_CONNECTION_TIMEOUT => 180, SoapClientInterface::WSDL_TRACE => 1, SoapClientInterface::WSDL_EXCEPTIONS => true, SoapClientInterface::WSDL_STREAM_CONTEXT => stream_context_create([ 'ssl' => [ // 'cafile' => base_path('cert/cacert-2024-03-11.pem'), 'verify_peer' => false, 'verify_peer_name' => false ], ]) ]; } /** * 响应格式化 * @param mixed $data * @return mixed * @throws Exception */ public function responseFormat(mixed $data): mixed { try { // 此处为xml格式 $obj = simplexml_load_string((string)$data, 'SimpleXMLElement', LIBXML_NOCDATA); return json_decode((string)json_encode($obj), true); } catch (Exception $e) { throw new Exception($e->getMessage()); } } /** * 返回值字段 * @return string */ public function transferResponseStr(): string { return $this->transfer_name. 'Result'; } }