简体   繁体   中英

Uncaught SoapFault exception: [HTTP] Not Found

Here is my code

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

i got this after var_dump of $client

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

however I am getting this message when i try to find var_dump($client->cacheTorrent());Uncaught SoapFault exception: [HTTP] Not Found

but this makes no sense to me because i downloaded the wdsl file and it plainly says that the operation cacheTorrent exists!!

here

<?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>

any ideas of why I am getting this error?

确保soap:address指向正确的现有服务

There is nothing wrong with your client code .... I you run

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

You would get

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

Apparently cacheTorrent is expecting a URL which needs to be a valid torrent .. am sure the error was generated on the soap server while trying too validate or access that url

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM