SOAP-ERROR: Parsing Schema: can't import schema from domain.com/WebService.svc?xsd=xsd0
SOAP-ERROR: Parsing Schema: can't import schema from domain.com/WebService.svc?xsd=xsd0
问题
我正在使用 Web 服务,但无法连接总是收到此错误消息:
SOAP-ERROR: Parsing Schema: can't import schema from domain.com/WebService.svc?xsd=xsd0
我确实去了所有的 SO 问题我没有找到解决方案。
服务器
Linux, php7.1
PHP 模块已启用
bz2, calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd,
gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd,
openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, pdo_sqlite, Phar, posix,
readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL,
sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml,
xmlreader, xmlwriter, xsl, zip, zlib
代码
$wsdlFile = **fullpathtowsdlfile**;
$context = stream_context_create([
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
],
'http'=>array(
'user_agent'=>'SoapClient'
)
]);
$options = array(
'trace'=>1,
'location'=>self::$wsdl,
'exception'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE,
//'stream_context'=>$context, // disable but leaved for reference.
'local_cert'=> **fullpath**,
'soap_version'=> SOAP_1_1
);
$client = new \SoapClient($wsdlFile, $options);
还尝试了 Url 而不是 Wsdl 文件,我得到了同样的错误。我可以通过 telnet 域 80、telnet 域 413 和我的浏览器连接到 url。
我错过了什么?任何帮助将不胜感激。
问题是自签名证书,将我的代码更新为这个,现在错误消失了。
$context = stream_context_create([
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]);
$options = array(
'trace'=>1,
'exception'=>0,
'stream_context'=>$context,
);
$client = new \SoapClient($wsdlFile, $options);
问题
我正在使用 Web 服务,但无法连接总是收到此错误消息:
SOAP-ERROR: Parsing Schema: can't import schema from domain.com/WebService.svc?xsd=xsd0
我确实去了所有的 SO 问题我没有找到解决方案。
服务器
Linux, php7.1
PHP 模块已启用
bz2, calendar, Core, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd,
gettext, hash, iconv, intl, json, ldap, libxml, mbstring, mysqli, mysqlnd,
openssl, pcntl, pcre, PDO, pdo_dblib, pdo_mysql, pdo_sqlite, Phar, posix,
readline, Reflection, session, shmop, SimpleXML, soap, sockets, SPL,
sqlite3, standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml,
xmlreader, xmlwriter, xsl, zip, zlib
代码
$wsdlFile = **fullpathtowsdlfile**;
$context = stream_context_create([
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
],
'http'=>array(
'user_agent'=>'SoapClient'
)
]);
$options = array(
'trace'=>1,
'location'=>self::$wsdl,
'exception'=>1,
'cache_wsdl'=>WSDL_CACHE_NONE,
//'stream_context'=>$context, // disable but leaved for reference.
'local_cert'=> **fullpath**,
'soap_version'=> SOAP_1_1
);
$client = new \SoapClient($wsdlFile, $options);
还尝试了 Url 而不是 Wsdl 文件,我得到了同样的错误。我可以通过 telnet 域 80、telnet 域 413 和我的浏览器连接到 url。
我错过了什么?任何帮助将不胜感激。
问题是自签名证书,将我的代码更新为这个,现在错误消失了。
$context = stream_context_create([
'ssl' => [
// set some SSL/TLS specific options
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
]);
$options = array(
'trace'=>1,
'exception'=>0,
'stream_context'=>$context,
);
$client = new \SoapClient($wsdlFile, $options);