刘桂岩 3 年之前
父节点
当前提交
840eed4747
共有 1 个文件被更改,包括 11 次插入6 次删除
  1. 11 6
      app/controller/Index.php

+ 11 - 6
app/controller/Index.php

@@ -20,17 +20,22 @@ class Index extends BaseController
     }
     public function getReport()
     {
-        use_soap_error_handler(false);
+
+        libxml_disable_entity_loader(false);
         $opts = array(
-            'http' => array(
-                'user_agent' => 'PHPSoapClient'
-            ),
             'ssl'   => array(
                 'verify_peer'          => false
             ),
+            'https' => array(
+                'curl_verify_ssl_peer'  => false,
+                'curl_verify_ssl_host'  => false
+            )
         );
-        $context = stream_context_create($opts);
-        $client = new \SoapClient('http://112.103.134.89:10020/server.php?wsdl',array("trace" => 1, "cache_wsdl" => WSDL_CACHE_NONE, "exception" => 1, 'stream_context' => $context));   //请求的ip localhost:8085为本机测试
+        $streamContext = stream_context_create($opts);
+        $client = new SoapClient("http://112.103.134.89:10020/server.php?wsdl",
+            array(
+                'stream_context'    => $streamContext
+            ));
         $data = [
             'Barcode'=>'12203310010001'
         ];   //请求参数