所以我尝试使用SoapClient进行连接,但遇到问题。
$this->client = new SoapClient(self::parser_url . '/SovrenConvertAndParse/ConvertAndParse.asmx?WSDL',array('soap_version' => SOAP_1_2
));
var_dump($this->client);
var_dump($this->client->__getFunctions());
try { var_dump($this->client->GetVersionInfo());}
catch (Exception $e){echo $e->getMessage();}
以下是我得到的结果:
object(SoapClient)#32 (2) {
["_soap_version"]=>
int(2)
["sdl"]=>
resource(42) of type (Unknown)
}
array(30) {
...
[18]=>
string(65) "GetVersionInfoResponse GetVersionInfo(GetVersionInfo $parameters)"
...
}
Not Found
看起来如果函数出现在getFunctions()中,那么我应该能够调用它,它应该是可以找到的。没有?什么可能导致这样的事情?
所以我在没有try / catch的情况下尝试了它,我收到以下错误:
Fatal error: Uncaught SoapFault exception: [HTTP] Not Found in /path/to/file:29
任何人对于可能发生的事情以及如何解决这个问题都有任何想法?
答案 0 :(得分:0)
这应该有用..
$this->client = new SoapClient(self::parser_url . '/SovrenConvertAndParse/ConvertAndParse.asmx?WSDL',array("soap_version" => SOAP_1_1
));
var_dump($this->client);
var_dump($this->client->__getFunctions());
try { var_dump($this->client->GetVersionInfo(GetVersionInfoResult=>"version"));} //this is where i am editing your question, you need to have a parameter passed
catch (Exception $e){echo $e->getMessage();}
答案 1 :(得分:0)
我来自Sovren,我偶然发现了这篇文章。由于您没有联系我们寻求支持,我认为您已经解决了这个问题。但对于其他读者,我使用PHP 5.2.12运行以下文件,并且对SOAP_1_1和SOAP_1_2的GetVersionInfo调用都正确响应:
<?php
$client = new SoapClient(
'http://localhost/SovrenConvertAndParse/ConvertAndParse.asmx?WSDL',
array('soap_version' => SOAP_1_2));
var_dump($client);
var_dump($client->__getFunctions());
try { var_dump($client->GetVersionInfo());}
catch (Exception $e){echo $e->getMessage();}
?>