我必须使用WSDL和SOAP与某个系统交互,但是当我用新的SoapClient php类加载wsdl文件时,我得到一个错误SOAP-ERROR: Parsing Schema: unresolved element 'ref' attribute 'http://get_xxxx_response.xxx.xx.xxxx.xxxx.com:HEADER'
(the xxxx我已经把,因为我不知道我是否可以张贴的实际值)http://get_xxxx_response.xxx.xx.xxxx.xxxx.com
被用作xmlns,并以如下方式对xsd文件进行目标分隔
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://get_xxxx_response.xxx.xx.xxxx.xxxx.com"
targetNamespace="http://get_xxxx_response.xxx.xx.xxxx.xxxx.com">
.
.
.
再次使用wsdl文件
<wsdl:definitions name="SERVICE_NAME"
.
.
.
xmlns:SERVICE_ACTION_NAME="http://get_xxxx_response.xxx.xx.xxxx.xxxx.com"
.
.
.
我用的php是
<?php
error_reporting(-1);
ini_set('display_errors', 1);
$context =[
'local_cert' => 'xxxx',
'passphrase' => 'xxxx',
'trace'=>true
];
$path='PATH_TO_THEWSDL';
try {
$soapclient = new SoapClient($path, $context);
} catch (Exception $e) {
echo $e->getMessage();
}
我已经在网上看了很多,但是没有任何可能的解决方案。当我使用相同的WSDL与SOAP UI时,它似乎有效。Maybse是一些我缺少的php soap客户端设置或smth。php版本是8.2.10。如果有人能至少指出我在哪里寻找解决方案,我将非常感激
1条答案
按热度按时间3pmvbmvn1#
经过大量的研究和反复试验,我发现如果我将xsd文件中的xs:include替换为xs:import,wsdl就能正确解析。
https://bugs.php.net/bug.php?id=44686