Php SOAPAPI未捕获SoapFault异常
我正在尝试使用他们的SOAP API将torrent上传到torcache.netPhp SOAPAPI未捕获SoapFault异常,php,soap,Php,Soap,我正在尝试使用他们的SOAP API将torrent上传到torcache.net <?php $client = new SoapClient('http://torcache.net/torcache.wsdl'); $info_hash = $client->cacheTorrent(base64_encode(file_get_contents('test.torrent'))); print_r($info_hash); ?> 参考,看看你是否能得到任何帮助 或
<?php
$client = new SoapClient('http://torcache.net/torcache.wsdl');
$info_hash = $client->cacheTorrent(base64_encode(file_get_contents('test.torrent')));
print_r($info_hash);
?>
参考,看看你是否能得到任何帮助
或
试试这个:
<?php
try {
$x = @new SoapClient("http://torcache.net/torcache.wsdl");
} catch (Exception $e) {
echo $e->getMessage();
}
?>
您可以调用您的cacheTorrent();在try-catch里面,看看它是否会返回“notfound”,我不知道这是什么意思。文件就在那里,我已经检查了5次…@TheBootyBay在这种情况下请尝试SoapClient::\uu getFunctions()它将打印属于wsdl的所有函数。如果您能够看到cacheTorrent()函数存在,那么可能是您传递了错误的参数,或者函数定义中有错误。它说:string cacheTorrent(string$torrent)查看您是否使用文件获取内容(“test.torrent”)获取数据。尝试将任何伪字符串传递给缓存函数,并查看其是否到达函数体。将WSDL从http更改为https。不确定这是否会产生影响(从手机上读取,因此无法测试),但注意到您的代码和他们的示例之间的差异(和torrent站点可能会很挑剔,尽管您可能认为他们可以重定向),并可能尝试在您的测试前添加“/”。torrent。。。可能正在查找错误的目录
<?php
try {
$x = @new SoapClient("http://torcache.net/torcache.wsdl");
} catch (Exception $e) {
echo $e->getMessage();
}
?>