Page 1 of 1

using mantisconnect from a php script

Posted: 26 May 2008, 06:57
by jramirez
In mantis 1.1.1 version, I'm trying to test mantisconnect creating my own php script, but I can't find any example of how to use it, and the standards nusoap examples are not working.
I have tried creating a test.php with the following code:
<?
include('api/soap/nusoap/nusoap.php');
$url = 'api/soap/mantisconnect.php';
$soapclient = new soapclient($url);
$function = 'mc_version';
$params = array('name' => 'Pepe');
$result = $soapclient->call( $function , $params );
echo $result;
?>

But I get this error:

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.mantisbt.org/bugs/api/soap/mantisconnect.php' in /var/www/apache2-default/test.php:7 Stack trace: #0 /var/www/apache2-default/test.php(7): SoapClient->SoapClient('http://www.mant...') #1 {main} thrown in /var/www/apache2-default/test.php on line 7

Re: using mantisconnect from a php script

Posted: 26 May 2008, 12:53
by giallu
This works for me:

Code: Select all

<?php
  require_once('nusoap.php');

  $endpoint = "http://www.mantisbt.org/bugs/api/soap/mantisconnect.php";

  $client = new soapclient($endpoint);

  $result = $client->call('mc_version',array());
  print_r($result);
output is "1.2.0a1"

Re: using mantisconnect from a php script

Posted: 04 Aug 2011, 13:51
by nourdine
hi !

I have test your example in my local machine
an have this error


PHP Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://localhost/mantis/api/soap/mantisconnect.php' : Extra content at the end of the document
in /var/www/mantis/test.php:4
Stack trace:
#0 /var/www/mantis/test.php(4): SoapClient->SoapClient('http://localhos...')



thanks by advance

Re: using mantisconnect from a php script

Posted: 10 Aug 2011, 19:52
by snapple42
I'm playing this a bit..

You need to add "?wsdl" to the end of the url..

Now I'm getting different errors!

Re: using mantisconnect from a php script

Posted: 19 Aug 2011, 14:19
by nourdine
Hi,
Please Expain me where to put this code, in order to test iti



Thanks By Adavance
Nourdine Chabane