PHP SOAP 错误 - 找不到<定义> [英] PHP SOAP Error - Couldn't find <definitions>

查看:18
本文介绍了PHP SOAP 错误 - 找不到<定义>的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有点卷曲,我无法解决(我没有经常使用 SOAP).

Bit of a curly one I can't work out (I've not used SOAP an awful lot).

我有一个需要使用的 WDSL Web 服务:https://gist.github.com/aleayr/0dc4f26b0b9dd6ba7dae

I have a WDSL web service I need to consume: https://gist.github.com/aleayr/0dc4f26b0b9dd6ba7dae

但是 PHP 在尝试使用它时抛出了一个致命错误,说

But PHP is throwing a Fatal error when trying to consume it, saying

PHP 致命错误:SOAP-ERROR:解析 WSDL:找不到 <定义>在第 37 行的 C:\path\to\submit.php 中的http://path/to/ServiceManager.svc?wsdl"中

我注意到实际的 XML 标签前面有一个 wdsl 命名空间,有什么方法可以让 PHP 识别这一点?

I note the actual XML tag has a wdsl namespace in front of it, is there any way to get PHP to recognise this?

推荐答案

我遇到了同样的错误.这一定是因为没有 Action-URI 的定义造成的.我是这样锻炼的:

I've the same error. This must be caused because there's no definition of the 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
}

至少对我来说这很好用.来源 SoapClient::__setLocation

At least for me this worked fine. Source SoapClient::__setLocation

这篇关于PHP SOAP 错误 - 找不到&lt;定义&gt;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆