Answer the question
In order to leave comments, you need to log in
PHP SOAP WSDL could not connect to host error?
Good afternoon! Your help is very much needed.
The problem is the following...
There is 213.132.76.210:5222/Modules/EleWise.ELMA.Workflow....
if you go to the bottom of the xml document, you will see that the web service address is slightly different in port (not 5222, but 222) - I I think this is the problem of the "could not connect to host" error. Those. xml gives the server normally, but does not accept the SOAP request.
host: Apache/2.4.10 (Unix), SERVER_PROTOCOL HTTP/1.1, PHP Version 5.6.23, SOAP client and server are enabled on the host
1) soapUI used a little, but the error is the same - the server does not respond to the xml request.
2) the server itself has a local IP with port 222, forwarded from the external IP 213.132.76.210:5222 to the internal 192.168.*.*:222
2) tried:
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);
$params = array ('encoding' => 'UTF-8', 'verifypeer' => false, 'verifyhost' => false, 'soap_version' => SOAP_1_2, 'trace' => 1, 'exceptions' => 1, "connection_timeout" => 10, 'stream_context' => stream_context_create($opts) );
'soap_version' => SOAP_1_1,
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
<?php
error_reporting(E_ALL);
$userName = "user"; //логин пользователя от которого будет запущен процесс
$password ="9512364"; //пароль пользователя от которого будет запущен процесс
$token = "***"; //токен процесса
$instanceName = "Обращения с сайта"; //название экземпляра процесса
$data = new stdClass();
$data->Items = new stdClass();
$data->Items->WebDataItem = array(); // Формируем массив контекстных переменных.
$data->Items->WebDataItem[0] = "stroka"; // из ПОСТ будем потом брать
$data->Items->WebDataItem[1] = "stroka2"; // из ПОСТ будем потом брать
$opts = array(
'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
);
$params = array ('encoding' => 'UTF-8', 'verifypeer' => false, 'verifyhost' => false, 'soap_version' => SOAP_1_2, 'trace' => 1, 'exceptions' => 1, "connection_timeout" => 10, 'stream_context' => stream_context_create($opts) );
ini_set('soap.wsdl_cache_enabled', '0');
ini_set('soap.wsdl_cache_ttl', '0');
try {
$urlWsdl = "http://213.132.76.210:5222/Modules/EleWise.ELMA.Workflow.Processes.Web/WFPWebService.asmx?WSDL";
$client = new SoapClient($urlWsdl, $params);
$parameters = array(
"userName"=>$userName,
"password"=>$password,
"token"=>$token,
"instanceName"=>$instanceName,
"data"=>$data);
$request = $client->Run($parameters); // делаем запрос, здесь Run это название функции в wsdl сервисе
$itog = $request->RunResult; // получаем запрос и присваиваем его переменной itog. Result это название поля которое отдаст wsdl
}
catch (SoapFault $exception)
{
echo $exception->getMessage(); // ошибка если не ок
}
?>
SoapClient, array( "location" => URL
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question