我无法在开发空间模拟器上测试USSD php应用程序

问题描述 投票:0回答:1

有人可以帮助我在开发空间模拟器上测试我的USSD PHP应用程序吗?因为我无法使用我在此链接上下载的开发空间模拟器在本地计算机上测试我的USSD应用程序:https://devspace.hsenidmobile.com/code/php/ussd/

我的应用程序有两个文件:index.php和recall.php位于此路径中:C:\ xampp \ htdocs \ ideamart

我的index.php代码

<?php 
header('Content-type:application/json'); 
$inputJson = file_get_contents('php://input'); 
$input = json_decode($inputJson,TRUE); 
?>
<?php
 include 'recall.php';
 ?>

recall.php

<?php 
$data['meesage']='Dialog Idea Mart Welcome..';
$data["applicationId"] = $input["applicationId"]; 
$data["password"] = "password";
$data["version"]="1.0";
$data["sessionId"]= $input["sessionId"];
$data["ussdOperation"]="mt-cont";
$data["destinationAddress"]= $input["sourceAddress"];
$data["encoding"]="440";
$data["chargingAmount"]="5";
$json_string = json_encode($data);
$ideamartURL = "http://localhost:7000/ussd/send";

$ch = curl_init($ideamartURL); 
$options = array (
    CURLOPT_RETURNTRANSFER => true, 
    CURLOPT_HTTPHEADER => array('Content-type : application/json'); 
    CURLOPT_POSTFIELDS => $json_string);
    curl_setopt_array($ch,$options); 
$result = curl_exec($ch); 
?>

但是当我尝试通过本地计算机上的Dev_space通过[http://localhost:10001/](下面的图片1获取更多详细信息)连接到我的应用程序时,它会给我一条失败的消息(下面的图片2显示失败消息)。

我不知道我是否错过了DEV_SPACE或我的APplicatioN或php.in文件中的某些配置

USSD simulators for testing my application in my computer

enter image description here

php sms-gateway ussd
1个回答
0
投票
$options = array (
    CURLOPT_RETURNTRANSFER => true, 
    CURLOPT_HTTPHEADER => array('Content-type : application/json'); 
    CURLOPT_POSTFIELDS => $json_string);

这是逗号而不是半冒号这里CURLOPT_HTTPHEADER => array('Content-type : application/json');CURLOPT_HTTPHEADER => array('Content-type : application/json')

和这里

$data['meesage']='Dialog Idea Mart Welcome..';

这是$data['message']

© www.soinside.com 2019 - 2024. All rights reserved.