【问题标题】:SoapClient::SoapClient in codeigniterCodeigniter 中的 SoapClient::SoapClient
【发布时间】:2015-05-02 12:01:21
【问题描述】:

我正在使用此代码

$userName=$this->input->post('user');
$password=$this->input->post('pass');
$lineNumber=$this->input->post('line');
$to= $this->input->post('Receiver');
$text=$this->input->post('messageBody');;

$client= new SoapClient('http://n.sms.ir/ws/SendReceive.asmx?wsdl');

$parameters['userName'] = $userName;
$parameters['password'] = $password;
$parameters['mobileNos'] = array(doubleval($to));
$parameters['messages'] = array($text);
$parameters['lineNumber'] = $lineNumber;
$parameters['sendDateTime'] = date("Y-m-d")."T".date("H:i:s");
print_r($client->SendMessageWithLineNumber($parameters));

但是会发生这种情况

遇到了 PHP 错误

严重性:警告

消息: SoapClient::SoapClient(http://n.sms.ir/ws/SendReceive.asmx?wsdl): 无法打开流:连接超时

文件名:views/sms.php

行号:19

遇到了 PHP 错误

严重性:警告

消息:SoapClient::SoapClient(): I/O 警告:加载失败 外部实体“http://n.sms.ir/ws/SendReceive.asmx?wsdl

文件名:views/sms.php

行号:19

有谁知道怎么回事?

【问题讨论】:

  • 我清理了你的语法,以便更容易阅读错误。根据错误,您的服务器无法打开 WSDL 地址。你能验证它可以打开它吗?如果是linux服务器,试试wget

标签: php web-services codeigniter wsdl soap-client


【解决方案1】:

转到文件system/core/CodeIgniter.php 并增加set_time_limit 默认设置为300

if (function_exists("set_time_limit") == TRUE AND @ini_get("safe_mode") == 0)
    {
        @set_time_limit(300);//increase it according to your requirement
    } 

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-11-27
    • 1970-01-01
    • 2016-02-01
    • 2011-03-30
    • 2014-07-09
    • 2015-10-14
    • 1970-01-01
    相关资源
    最近更新 更多