|
|
|
|
@ -137,23 +137,38 @@ class Tools
|
|
|
|
|
curl_setopt($ch, CURLOPT_POST, 1);
|
|
|
|
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml_data);
|
|
|
|
|
$r = curl_exec($ch);
|
|
|
|
|
\Illuminate\Support\Facades\Log::info($r);
|
|
|
|
|
$r = '<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
|
<SOAP-ENV:Envelope xmlns:SOAP-ENV=\'http://schemas.xmlsoap.org/soap/envelope/\' xmlns:xsi=\'http://www.w3.org/2001/XMLSchema-instance\' xmlns:s=\'http://www.w3.org/2001/XMLSchema\'>
|
|
|
|
|
<SOAP-ENV:Body><SendResponse xmlns="http://bjgoodwillcis.com"><SendResult><![CDATA[{"resultCode": 0, "resultMsg": "登记成功", "resultDatas": [{"videoRoom": "", "extNo": "41656268!2", "extParam": "", "checkNo": "USFF1604109", "imageNo": "0000000053", "patientUrl": "https://nanshan-jk.yizhen.cn/yizhen-patient/login?p=ODQwMDA2&itemFkBase=MTg5OTA5MDE", "currentNum": 0, "isStudyGroupRegistration": "Y", "queueNo": "A516"}], "isSuccess": true}]]></SendResult></SendResponse></SOAP-ENV:Body>
|
|
|
|
|
</SOAP-ENV:Envelope>';
|
|
|
|
|
try {
|
|
|
|
|
$res = explode('<SOAP-ENV:Body>', $r)[1];
|
|
|
|
|
$res = explode('</SOAP-ENV:Body>', $res)[0];
|
|
|
|
|
$xmlData = simplexml_load_string($res);
|
|
|
|
|
$jsonData = json_encode($xmlData, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
$xml = simplexml_load_string($r, 'SimpleXMLElement', LIBXML_NOCDATA);
|
|
|
|
|
$namespaces = $xml->getNamespaces(true);
|
|
|
|
|
$xml->registerXPathNamespace('soapenv', $namespaces['SOAP-ENV']);
|
|
|
|
|
$xml->registerXPathNamespace('ns', 'http://bjgoodwillcis.com');
|
|
|
|
|
|
|
|
|
|
// 提取 CDATA 内容
|
|
|
|
|
$sendResult = $xml->xpath('//ns:SendResult')[0];
|
|
|
|
|
$jsonData = (string)$sendResult;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// $res = explode('<SOAP-ENV:Body>', $r)[1];
|
|
|
|
|
// $res = explode('</SOAP-ENV:Body>', $res)[0];
|
|
|
|
|
// $xmlData = simplexml_load_string($res);
|
|
|
|
|
// $jsonData = json_encode($xmlData, JSON_UNESCAPED_UNICODE);
|
|
|
|
|
}catch (Exception $e) {
|
|
|
|
|
$jsonData = $e->getMessage();
|
|
|
|
|
}
|
|
|
|
|
// dd($res);
|
|
|
|
|
// $result = json_decode($jsonData, true);
|
|
|
|
|
|
|
|
|
|
$result = json_decode($jsonData, true);
|
|
|
|
|
// dd($result);
|
|
|
|
|
curl_close($ch);
|
|
|
|
|
$data=[
|
|
|
|
|
'response_data'=>$r
|
|
|
|
|
];
|
|
|
|
|
self::RequestLog($data,$log_id);
|
|
|
|
|
return $result;
|
|
|
|
|
return $jsonData;
|
|
|
|
|
}
|
|
|
|
|
public static function RequestLog($arr,$id,$mark='')
|
|
|
|
|
{ //记录请求日志
|
|
|
|
|
|