【发布时间】:2018-04-19 14:24:58
【问题描述】:
Drupal 7-soap
这是我在错误日志中遇到的错误,当我尝试打印 test.wsdl 文件
SoapFault: looks like we got no XML document in SoapClient->__call()
我不知道是什么错误
我的项目环境
PHP : 5.4.11
MySQL:5.5.27 阿帕奇:2.2.3
操作系统:CentOS 5.8
代码信息
function ai_server() {
ini_set('soap.wsdl_cache_ttl', 0);
$server = new SoapServer(file_create_url(variable_get('app_integration_wsdl')), array("trace" => 1, "exceptions" => 0));
$server->addFunction('getData');
$server->addFunction('getId');
$server->addFunction('getInfo');
$server->addFunction('getrightsInfo');
$server->addFunction('updateInfo');
$server->addFunction('resetAppHistory');
//$server->addFunction('resetAppId');
$server->handle();
}
肥皂客户端
function ai_sync_test() {
ini_set('soap.wsdl_cache_ttl', 0);
//
// ---------------------------------------------------------------- basic tests
//
// is settings file accessible
$settings_file = variable_get('app_integration_settings');
require_once($settings_file);
$settings_output = is_readable($settings_file) ? 'Ok! Settings file is readable.' : 'Error! Not readable or accessible.';
// is wsdl file accessible
$wsdl_file = variable_get('app_integration_wsdl');
$wsdl_output = is_readable($wsdl_file) ? 'Ok! WSDL file is readable. ' . l('Open it. ', $wsdl_file, array('attributes' => array('target' => '_blank'))) : 'Error! Not readable or accessible. ';
$wsdl_output .= 'You need to define domain name in it into this sections (at the bottom of app_integration.wsdl file): ';
$wsdl_output .= htmlentities('<soap:address location="http://YOUR_DOMAIN_HERE/app_integration/server"/>');
// methods, which integration service is provide
$client = new SoapClient($wsdl_file, array("trace" => 1, "exceptions" => 0));
$methods = $client->__getFunctions();
$methods_output = '';
foreach ($methods as $method) {
$methods_output .= '<li>' . $method . '</li>';
}
【问题讨论】:
-
请提供更多详细信息。你至少运行过的代码
-
@DenisAlimov 你去吧
-
尝试调用将跟踪选项设置为 TRUE 的客户端,并检查通过 __getLastRequest() 和 __getLastResponse() 方法发送/接收的实际 XML。
-
@bxN5 为空
-
它是 SOAP 服务器。然后你在某个地方调用 SoapClient。提供该代码