捕获异常:服务器无法在php中处理…

时间:2019-02-28 11:08:12

标签: php .net server

我正在尝试使用php中的SoapClient将我的网站连接到消息服务,这是我的php代码中的那一行:

$sms_client = new SoapClient('http://payamak-service.ir/SendService.svc?wsdl', array('encoding'=>'UTF-8'));

但是问题是从clinet到php文件的任何请求,php都会响应此错误:

  

捕获的异常:由于内部错误,服务器无法处理请求。有关错误的更多信息,请打开IncludeExceptionDetailInFaults(从ServiceBehaviorAttribute或从    配置行为),以便将异常信息发送回客户端,或者根据Microsoft .NET Framework SDK文档打开跟踪并检查服务器跟踪日志。

我已经使用apt-get安装了soap,有人知道我该如何解决?

edit,这是php代码:

<?php
error_reporting(E_ALL);
ini_set('display_errors', 'On');
ini_set("soap.wsdl_cache_enabled", "0");
$sms_client = new SoapClient('http://payamak-service.ir/SendService.svc? 
wsdl', array('encoding'=>'UTF-8'));

include '../login/config.php';
$ra = "SET NAMES utf8";
$connect = connection();
$connect->set_charset("utf8");
$res = $connect->query($ra);

$tracking_code = $_POST['tracking_code'];
$sql = "SELECT timestamp FROM certificate WHERE tracking_code=?";
$result = $connect->prepare($sql);
$result->bind_param("s",$tracking_code);
$result->execute();
$res=$result->get_result();
while ($row=$res->fetch_object()) {
    $output[]=$row;
}

$from = $_POST['from'];
$to = $_POST['to'];

try {
$parameters['userName'] = "---";
$parameters['password'] = "---";
$parameters['fromNumber'] = $to;
$parameters['toNumbers'] = array($from);
$parameters['messageContent'] = "test";
$parameters['isFlash'] = false;
$recId = array();
$status = array();
$parameters['recId'] = &$recId ;
$parameters['status'] = &$status ;


echo $sms_client->SendSMS($parameters)->SendSMSResult;
}
catch (Exception $e)
{
 echo 'Caught exception: ',  $e->getMessage(), "\n";
}

?>

0 个答案:

没有答案