我正在使用 PHP 版本 5.6 。我制作了一個 PHP 表單,有 3 個字段:用戶名、密碼和 CSV 文件上傳。CSV 文件每行包含兩個“數字代碼”,票號和發票號除以“;” ,這樣 CSV 有兩列。在我編寫的處理代碼中,我編寫了逐行讀取 CSV 文件并將票號和發票號分解為兩個變量的代碼。之后,代碼生成需要通過 GenericTicketConnectorSOAP 發送的 XML 數據并執行票證更新。我的 php 代碼如下:$URL = 'http://localhost/otrs/nphgenericinterface.pl/Webservice/GenericTicketConnectorSOAP';$NameSpace = 'http://www.otrs.org/TicketConnector/'; // SOAP parameters $parameters = ['proxy_host' => $URL,'proxy_port' => 8080,'stream_context' => stream_context_create(array('ssl' => array('verify_peer' => false,'verify_peer_name' => false,)))];// More code that it is not necessary to post it//Posting the code that the problem starts if(move_uploaded_file($_FILES['file']['tmp_name'],($path . $newfilename))){echo '<div class="alert alert-primary" role="alert"><p>Success: File uploaded.</p></div>'; $fn = fopen($path . $newfilename,"r"); while(! feof($fn) ) { $content = fgets($fn); // Divide the ticket number and the invoice number into two variables list($ticketnumber,$invoicenumber) = explode(";", $content); echo "TicketNumber: ".$ticketnumber." Invoicenumber: ".$invoicenumber; // Making XMLData
1 回答

HUH函數
TA貢獻1836條經驗 獲得超4個贊
通過在 php.ini 文件中添加以下行解決了該問題:
ini_set('soap.wsdl_cache_enabled', '0'); ini_set('soap.wsdl_cache_ttl', '0');
- 1 回答
- 0 關注
- 121 瀏覽
添加回答
舉報
0/150
提交
取消