using mantisconnect from a php script

Get help from other users here.

Moderators: Developer, Contributor

using mantisconnect from a php script

Postby jramirez » May 26, 2008 1:57 am

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
jramirez
 
Posts: 2
Joined: May 26, 2008 1:16 am

Re: using mantisconnect from a php script

Postby giallu » May 26, 2008 7:53 am

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"
giallu
 
Posts: 20
Joined: Feb 06, 2008 6:34 am

Re: using mantisconnect from a php script

Postby nourdine » Aug 04, 2011 8:51 am

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
nourdine
 
Posts: 9
Joined: Aug 04, 2011 3:39 am

Re: using mantisconnect from a php script

Postby snapple42 » Aug 10, 2011 2:52 pm

I'm playing this a bit..

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

Now I'm getting different errors!
snapple42
 
Posts: 1
Joined: Aug 10, 2011 2:50 pm

Re: using mantisconnect from a php script

Postby nourdine » Aug 19, 2011 9:19 am

Hi,
Please Expain me where to put this code, in order to test iti



Thanks By Adavance
Nourdine Chabane
nourdine
 
Posts: 9
Joined: Aug 04, 2011 3:39 am


Return to Help

Who is online

Users browsing this forum: No registered users and 1 guest

cron