简体   繁体   English

PHP SOAP错误-找不到<definitions>

[英]PHP SOAP Error - Couldn't find <definitions>

Bit of a curly one I can't work out (I've not used SOAP an awful lot). 我无法解决一个卷曲的问题(我还没有使用SOAP太多)。

I have a WDSL web service I need to consume: https://gist.github.com/aleayr/0dc4f26b0b9dd6ba7dae 我有一个需要使用的WDSL Web服务: https : //gist.github.com/aleayr/0dc4f26b0b9dd6ba7dae

But PHP is throwing a Fatal error when trying to consume it, saying 但是PHP在尝试使用它时抛出了致命错误,说

PHP Fatal error: SOAP-ERROR: Parsing WSDL: Couldn't find <definitions> in 'http://path/to/ServiceManager.svc?wsdl' in C:\\path\\to\\submit.php on line 37

I note the actual XML tag has a wdsl namespace in front of it, is there any way to get PHP to recognise this? 我注意到实际的XML标记在其前面有一个wdsl命名空间,是否有任何方法可以使PHP认识到这一点?

I've the same error. 我有同样的错误。 This must be caused because there's no definition of the Action-URI. 这是由于没有Action-URI的定义引起的。 I've worked out like this: 我已经这样算了:

public function testSOAPService()
{
$soap_action = "http://tempuri.org/XXXsomething/ActualURI";
$service = new SoapClient($this->wsdl); //WSDL defined before
$service->__setLocation($soap_action);
return $service->__getFunctions(); //you must see the functions of that service
}

At least for me this worked fine. 至少对我来说,这很好。 Source SoapClient::__setLocation SoapClient :: __ setLocation

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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