1

I'm trying to integrate the MantisBT API into my WordPress site (via a plugin) and I am behind a corporate proxy http://proxy:8080.

I followed the doc mantis to get the link of the API which must be for me: http://localhost:8181/api/soap/connectmantis.php?wsdl When I put this link in my browser, I can read the API doc -I guess that's what it should display-.

However, when I use the URL in my code of my WordPress site, it throws this error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from "http://localhost:8181/api/soap/mantisconnect.php' : failed to load external entity "http://localhost:8181/api/soap/mantisconnect.php"

Here a sample of my code:

class connectMantis{
    private $client = null;

    function __construct(){
       $username = 'myusername';
       $password = 'mypassword';
       $wsdl = 'http://localhost:8181/api/soap/mantisconnect.php?wsdl';

       $connectionParams = array(
          "authentication" => "SOAP_AUTHENTICATION_BASIC",
          "login" => $username,
          "password" => $password
       );

       $this->client = new SoapClient($wsdl, $connectionParams); 
       ....
}

I guess it could the proxy which is the problem but I don't know how to proceed..

IMPORTANT EDITS

I had network troubles with my docker images but now that I put all my images on the same local network, it should be better! I still have a wsdl error that I don't understand at all...

So I can access the mantis wsdl when I put this into my PHP code: echo file_get_contents($wsdl);

But when I try to user the SoapClient as I show above $this->client = new SoapClient($wsdl, $connectionParams);, I get a new error.

Here it is: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '/var/www/html/html/pages' : Document is empty ... Does anyone have any idea?

Melinsuna
  • 193
  • 1
  • 10

0 Answers0