Есть некий wsdl сервер, допустим "
https://192.168.333.3/LNetworkServer/LNetworkServi..." (адрес для поста выдуманный).
В браузере открывается нормально.
Когда пробую использовать SOAP, выдает ошибку:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://sh333skd1-dev/LNetworkServer/LNetworkService.svc?wsdl=wsdl0' : failed to load external entity "https://sh333skd1-dev/LNetworkServer/LNetworkService.svc?wsdl=wsdl0"
Если пробую cURL, ошибок нет, спокойно получаю XML.
Разработчики молчат, дали мне такой код:
$wsdl = "https://192.168.333.3/LNetworkServer/LNetworkService.svc?wsdl";
$arrContextOptions=array(
'ssl'=>array(
'verify_peer'=>false,
'verify_peer_name'=>false,
'allow_self_signed' => true
),
'https' => array(
'curl_verify_ssl_peer' => false,
'curl_verify_ssl_host' => false)
);
$options =array(
'trace' => 1,
'soap_version' => SOAP_1_1,
'location'=>'https://192.168.333.3/LNetworkServer/LNetworkService.svc',
'exceptions' => 1,
'cache_wsdl'=>WSDL_CACHE_NONE,
'verifypeer' => false,
'verifyhost' => false,
'stream_context' => stream_context_create($arrContextOptions),
'login'=>'root', 'password'=>'1234' ,
'classmap' => array('AcsEmployeeSaveData' => "AcsEmployeeSaveData")
);
//подключение
$client = new SoapClient($wsdl, $options);
Сам пробовал такой вариант:
try {
$opts = array(
'ssl'=>array(
'verify_peer'=>false,
'verify_peer_name'=>false,
'allow_self_signed' => true
),
'https' => array(
'curl_verify_ssl_peer' => false,
'curl_verify_ssl_host' => false,
'user_agent' => 'PHPSoapClient',
'allow_self_signed' => true
)
);
$context = stream_context_create($opts);
$wsdlUrl = 'https://192.168.333.3/LNetworkServer/LNetworkService.svc?wsdl';
$soapClientOptions = array(
'trace' => 1,
'location'=>'https://192.168.333.3/LNetworkServer/LNetworkService.svc',
'exceptions' => 1,
'cache_wsdl'=>0,
'verifypeer' => false,
'verifyhost' => false,
'stream_context' => $context,
'login'=>'root', 'password'=>'1234' ,
'classmap' => array('AcsEmployeeSaveData' => "AcsEmployeeSaveData")
);
$client = new SoapClient($wsdlUrl, $soapClientOptions);
}
catch(Exception $e) {
echo $e->getMessage();
}
Оба варианта выдают одинаковую ошибку, описанную выше
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://sh333skd1-dev/LNetworkServer/LNetworkService.svc?wsdl=wsdl0' : failed to load external entity "https://sh333skd1-dev/LNetworkServer/LNetworkService.svc?wsdl=wsdl0"
В чем проблема?