PHP SoapClient 创建错误:“命名空间必须与封闭架构不匹配”
尝试创建 SoapClient 对象时出现“命名空间必须与封闭架构不匹配”错误。代码很简单:
<?php $client = new \SoapClient('http://www.server.com/Service?wsdl');
如何通过忽略此错误来创建对象?
I'm getting "Namespace must not match the enclosing schema" error when trying to create SoapClient object. Code is simple:
<?php $client = new \SoapClient('http://www.server.com/Service?wsdl');
How can I create object by ignoring this error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定 WSDL 是什么样子,所以很难判断是否可以避免该错误。但是,您可以切换到使用非 WSDL 模式创建
SoapClient
:其中
location
和uri
描述为:来源: http://www.php.net/manual/en/soapclient.soapclient .php
I'm not sure what the WSDL looks like, so it's a bit hard to tell if the error can be avoided. However, you can switch to creating a
SoapClient
using non WSDL mode:Where
location
anduri
are described as:Source: http://www.php.net/manual/en/soapclient.soapclient.php