Soapclient 解析架构:无法从中导入架构
示例脚本:
try {
$client = new SoapClient("http://webservices.sabre.com/wsdl/sabreXML1.0.00/GHT/HotelDirectUpdate.wsdl", array("trace" => 0));
} catch (Exception $ex) {
var_dump($ex->faultcode, $ex->faultstring, $ex->faultactor, $ex->detail, $ex->_name, $ex->headerfault);
}
输出:
string(4) "WSDL"
string(216) "SOAP-ERROR: Parsing Schema: can't import schema from 'http://webservices.sabre.com/wsdl/sabreXML1.0.00/GHT/HotelDirectUpdateRQ.xsd', unexpected 'targetNamespace'='http://webservices.sabre.com/hgc/hoteldirectupdaterq'"
NULL
NULL
NULL
NULL
我知道 wsdl 文件是正确的。我通过 http://www.soapclient.com/interop/interopTest.html 看起来还不错。但是当我从 php 调用 wsdl 文件时,它给出了上述错误。
有什么想法/建议吗?
Example Script :
try {
$client = new SoapClient("http://webservices.sabre.com/wsdl/sabreXML1.0.00/GHT/HotelDirectUpdate.wsdl", array("trace" => 0));
} catch (Exception $ex) {
var_dump($ex->faultcode, $ex->faultstring, $ex->faultactor, $ex->detail, $ex->_name, $ex->headerfault);
}
Output :
string(4) "WSDL"
string(216) "SOAP-ERROR: Parsing Schema: can't import schema from 'http://webservices.sabre.com/wsdl/sabreXML1.0.00/GHT/HotelDirectUpdateRQ.xsd', unexpected 'targetNamespace'='http://webservices.sabre.com/hgc/hoteldirectupdaterq'"
NULL
NULL
NULL
NULL
I know wsdl file is correct. I checked wsdl file via http://www.soapclient.com/interop/interopTest.html and it is looking ok. but when i call the wsdl file from php it is giving above error.
Any idea/advice?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我们还发现 SoapClient 无法处理某些模式,但不会出现您收到的错误。最不糟糕的解决方案似乎是使用 Java 与 SOAP 服务交互,通过 PHP-Java Bridge 或 Gearman 进行 PHP-Java 互操作。
We have also found SoapClient to be incapable of handling certain schemas, though not with the error you get. The least bad solution seems to be to use Java to interact with the SOAP service, with PHP-Java Bridge or Gearman to do the PHP-Java interop.
某些版本的 PHP 存在一些已知错误,也许您正在运行较旧的 PHP 版本?
There are some bugs known in some versions of PHP, perhaps you're running an older PHP version?