我想连接一个SOAP客户端(通过PHP 7.4)。
提供的数据为https://plc.post.at/Post.Webservice/ShippingService.svc?wsdl Der HTTPS端点:https://plc.post.at/Post.Webservice/ShippingService.svc/secure
如何连接SOAP客户端?我总是得到SOAP-ERROR:解析WSDL:无法从'https://plc.post.at/Post.Webservice/ShippingService.svc加载?wsdl':无法加载外部实体“https://plc.post.at/Post.Webservice/ShippingService.svc?wsdl“
$soap = new SoapClient('https://plc.post.at/Post.Webservice/ShippingService.svc?wsdl', $options); should connect but does not.
$options = array(
'follow_location' => 1,
'cache_wsdl' => 0,
'allow_redirects' => true,
'http_errors' => true,
'decode_content' => true,
'verify' => false,
'cookies' => false,
'idn_conversion' => false,
// SSL Configuration
'stream_context' => $context,
'trace' => 0,
'exceptions' => true,
'ciphers' => 'RC4-SHA',
'soap_version' => SOAP_1_2,
'stream_context' => stream_context_create(array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
)));
1条答案
按热度按时间ssm49v7z1#
我在本地设置了这个,并尝试使用
SoapClient
连接:这给了我你在文章中描述的同样的错误:
解析WSDL:无法从“https://...”加载:无法加载外部实体“https://...”
我更改了
php.ini
配置中的以下行。;extension=openssl
至extension=openssl
;extension=soap
至extension=soap
;extension=php_openssl.dll
至extension=php_openssl.dll
1.已重新启动Web服务器
WSDL
位于https
连接的后面,这就是您需要启用扩展的原因。使用
$client->__getFunctions();
可以获得: