- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在尝试重写一个 Drupal 模块,该模块已经落后于它连接到的网关的 API。
我认为导致问题的代码的精简版本如下:
$namespace = ($this->testing) ? 'https://api.sandbox.ewaypayments.com/' : 'https://api.ewaypayments.com/';
$endpoint = $this->url;
$httpUsername = $this->user_name;
$httpPassword = $this->password;
$client = new nusoap_client($endpoint, TRUE);
$client->setCredentials($httpUsername, $httpPassword, 'basic');
$client->response_timeout = 50;
$result = $client->call($operation, array('request' => $params), $namespace);
$result
始终为假。如果我将这样的东西放入我的代码中,它也会始终返回 empty
:
$error = $client->getError();
watchdog('connection_message', $error);
我有点不知所云,在我的 Apache 日志或 Drupal 看门狗中没有任何错误消息,我看不到前进的方向。
最佳答案
<强>1。打开 PHP 错误报告(如果尚未打开)。
检查 php.ini
文件中的 error_reporting
、display_errors
设置是否设置为 E_ALL
和 On
当你在本地开发时。您还可以在 PHP 脚本的开头添加这些指令以在运行时设置它们:
error_reporting(E_ALL);
ini_set('display_errors', 'On');
<强>2。像这样捕获 NuSOAP 错误:
$result = $client->call($operation, array('request' => $params), $namespace);
if ($client->fault) {
echo 'Error: ';
print_r($result);
} else {
// check result
$err_msg = $client->getError();
if ($err_msg) {
// Print error msg
echo 'Error: '.$err_msg;
} else {
// Print result
echo 'Result: ';
print_r($result);
}
}
<强>3。验证您使用的 API 参数和端点是否正确:
来自eWAY API reference ,您的端点是:
https://api.ewaypayments.com/soap.asmx (production)
https://api.sandbox.ewaypayments.com/soap.asmx (sandbox)
<强>4。您可以进行逆向工程的类似 eWAY API 项目:
关于php - 如何调试需要基本身份验证但根本没有响应的 php nusoap 调用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29979971/
我在 stackoverflow 上的某处读到,使用 NuSoap 不是一个好主意,它已经死了。如果是,创建 WSDL 文件的最佳解决方案是什么。我只是 nusoap 只是为了创建 wsdl 文件,我
我在使用 NuSOAP 传输文件时遇到问题。我知道您可以读取文件并将其作为字符串传输,但它不起作用。这是一个例子: 客户: require('libraries/nusoap/nusoap.php')
require_once('soap/nusoap.php'); $soap = new soap_server(); $soap->configureWSDL('ClientSecurityServ
我是这方面的新手,也是编程新手。我正在尝试创建一个基于 nusoap 和 php 的 Web 服务,以便它从 mysql 数据库传递一些值。我浏览了许多网站(包括堆栈溢出答案),发现了一些我尝试过但尚
使用 .NET WCF 网络服务时,我收到以下响应(错误): Unsupported HTTP response status 415 Cannot process the message becau
无法弄清楚如何使 NuSOAP 使用 UTF-8 作为内容类型。它不断吐出“ISO-8859-1”。这是我尝试过的相关代码位: $soapclient=new soapclient($url1,'ws
我正在用 php 编写 soap 服务器和 soap 客户端。对于 soap 服务的身份验证,我想使用“usernametoken”来确保安全。任何人都可以将使用 nusoap 在服务器和客户端中应用
当尝试实例化我的 nuSoap 方法 authenticateUser 时,它说: Fatal error: Uncaught SoapFault exception: [Client] Functi
我有 NuSOAP 网络服务器:... $server->register('getMembersEvents', array('date' => 'xsd:str
您好,我正在为 nusoap 服务器使用此代码,但是当我在 Web 浏览器中调用服务器时,它显示消息“此服务不提供 Web 描述”这是代码 register('hello'); // create t
我正在使用 PHP 中的 NuSoap 库构建 Web 服务。我的网络服务将充当客户端和供应商已经存在的网络服务之间的中间层。因此,客户端不会直接连接到供应商,而是连接到我的 Web 服务,我的 We
我有一个 php 类,我想将它与 Nusoap 一起使用.我可以使用 register 命令注册 nusoap 中已经存在的类方法吗? 示例: 在这里我们注册了一个我们在这个脚本中定义的函数。但是如果
我想在我的网络服务中返回一个字符串数组 我试过: configureWSDL('NewsService', 'urn:NewsService'); $server->register('GetAllN
我在尝试发送重复标签时遇到了 NuSOAP 问题。这是我需要发送的代码: string1 string2 我正在使用以下代码进行通话: $pn[] = 'APPSP2101
我想在 Laravel 5.3 和 PHP7 上使用 nusoap。但是当我尝试使用那个包中的 composer 安装它时: https://github.com/codecasts/nusoap-p
我正在使用 nosoap 在 PHP 中开发 Web 服务。这是我的文件,webservice.php configureWSDL('myWS', $namespace); $server->wsdl
我正在使用 NuSOAP 尝试使用以 Java 构建的 Web 服务。到目前为止我有这段代码: 'John'); echo $client->call('Hey', $param); unset($c
我一直在使用 nuSOAP 在 PHP 中编写演示 Web 服务。 我想知道 nuSOAP 对 SOAP PHP5 类的优势是什么。 另外,这是一个用作模型的测试网络服务。 我想知道我应该测试哪些典型
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
目前我使用的是 PHP 版本 5.4.16 和 NuSoap 0.95,我试过这个例子: here 它显示了这样的服务器代码; $server->wsdl->addComplexType( '
我是一名优秀的程序员,十分优秀!