The SOAP function called with localhost, works, when I call with external IP and port, returns Forbidden error

174 Views Asked by At

Function called:

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;
}

Line called:

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

Returns Errors:

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

Instead, if I call the same function with "http: //localhost/InterfacesWS/IInterfacesBO3.asmx? WSDL" I have no error. It works correctly.

How do I eliminate the SoapFault: Forbidden error?

0

There are 0 best solutions below