M
M
Mrcus4D2020-10-30 12:54:47
PHP
Mrcus4D, 2020-10-30 12:54:47

No response from WSDL SOAP.? Where is the problem?

Hello.
Who faced SOAP WSDL.
Can't get response from WSDL....
Request

<?
require_once('Pass.php');

ini_set("vttp.wsdl_cache_enabled", "1"); // включаем кэширование WSDL
//Создаем SOAP-клиента

$client = new SoapClient("http://api.vtt.ru:8048/Portal.svc?singleWsdl", 
            array(	'login'		=>	$login, 
                'password'	=>	$password,
                'trace'		=> 	true	// трассировка запроса
              ));
try 
{  
  //Выводим все функции
  //print_r($client->__getFunctions());
  echo '<br />';
  
  
  //Получаем статус сообщения
  echo $client->GetCategoryItems(1).'<br />';
    
  
} 
catch (SoapFault $exception) 
{
  echo $exception;
}
?>


Answer:

SoapFault exception: [s:ACCESS_DENIED] Invalid credentials. in /home/a0178672/domains/api.aur01.ru/public_html/soap_send_sms.php:28
Stack trace:
#0 /home/a0178672/domains/api.aur01.ru/public_html/soap_send_sms.php(28): SoapClient->__call('GetCategoryItem...', Array)
#1 /home/a0178672/domains/api.aur01.ru/public_html/soap_send_sms.php(28): SoapClient->GetCategoryItems(1)
#2 {main}

ACCESS_DENIED - supposedly the login and password are not correct, but everyone checked everything is correct, there is a possibility that the request to the WSDL api.vtt.ru:8048/Portal.svc?singleWsdl
is not correctly composed Who knows, tell me, I just started to figure it out... but so far I don't have much experience...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2020-10-30
@Rsa97

Judging by the WSDL, the authorization is not done by means of HTTP, but in the backend itself. This means that you do not need to specify a login and password when creating a SoapClient. But they need to be specified in each request, for example

$client->GetCategoryItems(['login' => $login, 'password' => $password, 'categoryId' => 1])

Actually, this is also written in the API documentation .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question