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

+ 10 - 1
app/controller/Index.php

@@ -21,7 +21,16 @@ class Index extends BaseController
     public function getReport()
     {
         use_soap_error_handler(false);
-        $client = new \SoapClient('http://112.103.134.89:10020/server.php?wsdl');   //请求的ip localhost:8085为本机测试
+        $opts = array(
+            'http' => array(
+                'user_agent' => 'PHPSoapClient'
+            ),
+            'ssl'   => array(
+                'verify_peer'          => 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为本机测试
         $data = [
             'Barcode'=>'12203310010001'
         ];   //请求参数