Функция SOAP, вызываемая с localhost, работает, когда я звоню с внешним IP и портом, возвращает Forbidden error - PullRequest
1 голос
/ 05 апреля 2019

Вызванная функция:

public function getAcces($plngVersiune, $pstrNumeFirma, $pstrUtilizator, $pstrParolaSecurizata, $wsdl)
{
    $this->plngVersiune =               $plngVersiune;
    $this->pstrNumeFirma =              $pstrNumeFirma;
    $this->pstrUtilizator =             $pstrUtilizator;
    $this->pstrParolaSecurizata =       $pstrParolaSecurizata;
    $this->wsdl =                       $wsdl;

    $xml_array = array();
    $xml_array['plngVersiune'] = $this->plngVersiune;
    $xml_array['pstrNumeFirma'] = $this->pstrNumeFirma;
    $xml_array['pstrUtilizator'] = $this->pstrUtilizator;
    $xml_array['pstrParolaSecurizata'] = $this->pstrParolaSecurizata;
    $client = new SoapClient($wsdl);  // , array('trace' => $trace, 'exceptions' => $exceptions)
    var_dump($client);

    $clientToken = $client->LogIn($xml_array)->LogInResult;

    var_dump($clientToken);
    //unset($xml_array);

    return $clientToken;
}

Строка называется:

$acces = $gru->getAcces(1,"ALM","Administrator","d41d8cd98f00b204e9800998ecf8427e", "http://82.108.151.XXX:8080/InterfacesWS/IInterfacesBO3.asmx?WSDL");

Возвращает ошибки:

Fatal error: Uncaught SoapFault exception: [HTTP] Forbidden in C:\Program Files (x86)\Ampps\www\soap\class_01.php
SoapFault: Forbidden in C:\Program Files (x86)\Ampps\www\soap\class_01.php

Вместо этого, если я вызываю ту же функцию с "http: //localhost/InterfacesWS/IInterfacesBO3.asmx? WSDL", у меня нет ошибки. Работает правильно.

Как устранить ошибку SoapFault: Forbidden?

...