【问题标题】:Uncaught SoapFault exception: [HTTP] Not Found未捕获的 SoapFault 异常:[HTTP] 未找到
【发布时间】:2012-09-15 16:36:32
【问题描述】:

这是我的代码

  $client = new SOAPClient ( 'http://torcache.net/torcache.wsdl');
    var_dump($client->cacheTorrent());

我在var_dump of $client 之后得到了这个

object(SoapClient)#1 (2) { ["_soap_version"]=> int(1) ["sdl"]=> resource(1) of type (Unknown) }

但是,当我尝试查找 var_dump($client->cacheTorrent()); 时收到此消息 未捕获的 SoapFault 异常:[HTTP] Not Found

但这对我来说毫无意义,因为我下载了 wdsl 文件,它清楚地表明存在 cacheTorrent 操作!!

这里

<?xml version='1.0' encoding='UTF-8' ?>
<definitions name='Cache'
  targetNamespace='urn:Torcache'
  xmlns:tns='urn:Torcache'
  xmlns:soap='http://schemas.xmlsoap.org/wsdl/soap/'
  xmlns:xsd='http://www.w3.org/2001/XMLSchema'
  xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/'
  xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/'
  xmlns='http://schemas.xmlsoap.org/wsdl/'>

<message name='cacheTorrentRequest'>
  <part name='torrent' type='xsd:string'/>
</message>

<message name='cacheTorrentResponse'>
  <part name='Result' type='xsd:string'/>
</message>

<portType name='CachePortType'>
  <operation name='cacheTorrent'>
    <input message='tns:cacheTorrentRequest'/>
    <output message='tns:cacheTorrentResponse'/>
  </operation>
</portType>

<binding name='CacheBinding' type='tns:CachePortType'>
  <soap:binding style='rpc'
    transport='http://schemas.xmlsoap.org/soap/http'/>

  <operation name='cacheTorrent'>
    <soap:operation soapAction='urn:xmethods-delayed-quotes#cacheTorrent'/>
    <input>
      <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </input>
    <output>
      <soap:body use='encoded' namespace='urn:xmethods-delayed-quotes'
        encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'/>
    </output>
  </operation>
</binding>

<service name='CacheService'>
  <port name='CachePort' binding='CacheBinding'>
    <soap:address location='http://torcache.net/api/soap/'/>
  </port>
</service>
</definitions>

关于我为什么会收到此错误的任何想法?

【问题讨论】:

    标签: php soap


    【解决方案1】:

    您的客户端代码没有任何问题....我运行

    $client = new SOAPClient ( 'http://torcache.net/torcache.wsdl');
    var_dump($client->__getFunctions());
    

    你会得到

    array
      0 => string 'string cacheTorrent(string $torrent)' (length=36)
    

    显然cacheTorrent 期待一个 URL,该 URL 需要是一个有效的 torrent .. 确定错误是在肥皂服务器上生成的,同时尝试验证或访问该 URL

    【讨论】:

    • hello baba 感谢您的有用回答,但是即使在我使用有效的 url 进行操作后,我仍然会收到此错误
    • 我的错误是这个致命错误:未捕获的 SoapFault 异常:[HTTP] Not Found in /home/public_html/manualtorcache.php:8 堆栈跟踪:#0 [内部函数]:SoapClient->__doRequest( 'torcache...', 'urn:xmethods-de...', 1, 0) #1 /home/public_html//manualtorcache.php(8) : SoapClient->__call('cacheTorrent', Array) #2 /home/public_html/manualtorcache.php(8): SoapClient->cacheTorrent('ZDg6YW5ub3VuY2U...') #3 {main} 抛出
    • 我遇到了与 SOAP 类似的问题。有什么解决办法吗?
    • 此错误的任何解决方案致命错误:未捕获的 SoapFault 异常:[HTTP] Not Found in xxxx?
    猜你喜欢
    • 2018-07-07
    • 2011-10-25
    • 2010-10-29
    • 2015-07-08
    • 2013-10-10
    • 2023-03-12
    • 1970-01-01
    • 2012-02-18
    • 1970-01-01
    相关资源
    最近更新 更多