MantisConnect.php Error - Couldn't load from 'http://www.mantisbt.org/demo/api/soap/mantisconnect.php' : failed to load external entity

StackOverflow https://stackoverflow.com/questions/22488969

  •  16-06-2023
  •  | 
  •  

문제

I am trying to get the status of issues from Mantis. Having search through other posts here, people indicate that the web service on their site should be working. However I get the error when attempting this. Openssl, SOAP, curl, etc... are all enabled in my PHP (5.4.26).

Sample code: (External Mantis works)

<?php
$SoapWSDLAddress = 'http://www.mantisbt.org/demo/api/soap/mantisconnect.php?wsdl';
$Client = new SoapClient($SoapWSDLAddress, array('trace' => true, 'encoding' => 'UTF-8', 'soap_version' =>SOAP_1_2));
...
?>

Internal Site, which has MantisConnect installed that gets Exception.

<?php
$SoapWSDLAddress = 'http://192.168.0.1/mantis/api/soap/mantisconnect.php?wsdl';
$Client = new SoapClient($SoapWSDLAddress, array('trace' => true, 'encoding' => 'UTF-8', 'soap_version' =>SOAP_1_2));
...
?>

I get an exception on the SoapClient call:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from ' http://192.168.0.1/mantis/api/soap/mantisconnect.php?wsdl' : failed to load external entity "http://192.168.0.1/mantis/api/soap/mantisconnect.php?wsdl"

Going to the web address in my browser does show me the output for Mantis connect.

도움이 되었습니까?

해결책

Original code posting had a space before the http:// which caused the problem. Changing the code to remove the space fixed the error.

$SoapWSDLAddress = 'http://www.mantisbt.org/demo/api/soap/mantisconnect.php?wsdl';
$Client = new SoapClient($SoapWSDLAddress, array('trace' => true, 'encoding' => 'UTF-8', 'soap_version' =>SOAP_1_2));
...
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top