Skip to content
Nirav MehtaSearch

XPlanner PHP SOAP Client

I am working on a project management system and want to build a Mylyn plugin such that all tasks from the PMS show up in Eclipse / Aptana. I want to adapt…

I am working on a project management system and want to build a Mylyn plugin such that all tasks from the PMS show up in Eclipse / Aptana. I want to adapt Extreme Programming model of Iterations - User Stories and Tasks. XPlanner does this really well, and Mylyn already has an XPlanner connector.

So I want to keep the same XPlanner API and hook that up with my PMS! (Don't have time / skills to build a new Mylyn connector yet!)

XPlanner has a SOAP client in PHP, but that's written in NuSOAP. PHP's SOAP support uses a different convention for web services. Here's a simple XPlanner SOAP client for PHP (right after the jump!)

<?php
$options['login'] = 'sysadmin';
$options['password'] = 'admin';
$xplanner = new SoapClient('http://localhost:7070/soap/XPlanner?wsdl', $options);
?>

<html>
<body>
<H1>XPlanner PHP SOAP Example</H1>
<?php
// Dump all properties of an object
function dump_props($obj)
{
	echo '<ul>';
	foreach ($obj as $key=>$value)
	{
		echo '<li>'.$key.': '.$value.'</li>';
	}
	echo '</ul>';
}

$projects = $xplanner->getProjects();
foreach ($projects as $project)
{
	echo '<h1>'.$project->name.'</h1><p>'.$project->description.'</p>';
	$iterations = $xplanner->getIterations($project->id);
	foreach($iterations as $iteration)
	{
		echo '<h2>'.$iteration->name.'</h2><p>'.$iteration->description.'</p>';
		dump_props($iteration);
		$stories = $xplanner->getUserStories($iteration->id);
		foreach($stories as $story)
		{
			echo '<h3>'.$story->name.'</h3><p>'.$story->description.'</p>';
			dump_props($story);
			$tasks = $xplanner->getTasks($story->id);
			foreach ($tasks as $task)
			{
				echo '<h4>'.$task->name.'</h4><p>'.$task->description.'</p>';
				dump_props($task);
			}
		}
	}
}
?>

References:

Esc to closeopen the full search page