Location: PHPKode > projects > SOA For Virtuemart (WebServices) > com_vm_soa/admin/views/vm_soa/view.html.php
<?php

/**
 * @package    	com_vm_soa (WebServices for virtuemart)
 * @author		Mickael Cabanas (cabanas.mickael|at|gmail.com)
 * @link 		http://sourceforge.net/projects/soa-virtuemart/
 * @license    	GNU/GPL
*/


defined('_JEXEC') or die();
//echo '<br>'.__FILE__;
jimport( 'joomla.application.component.view' );
class vm_soaViewvm_soa extends JView{
  function config($tpl = null){
		JRequest::getVar('trace')->trace_it(__FILE__." config début", 1, 1);
	
		JRequest::getVar('trace')->trace_it(__FILE__." config fin", 1, -1);
  }
  function display($tpl = null){
		JRequest::getVar('trace')->trace_it(__FILE__." display début", 1, 1);
	//$task 	= trim( mosGetParam( $_REQUEST, 'task', '' ));
	//$act 	= trim( mosGetParam( $_REQUEST, 'act', '' ));
	$task = JRequest::getCmd( 'task' );
	$act = JRequest::getCmd( 'act' );
//echo "<br>task = ".$task;
//echo "<br>act = ".$act;
    JToolBarHelper::title( JText::_( 'Interface WebServices VirtueMart' ), 'generic.png' );
    JToolBarHelper::publishList();
    JToolBarHelper::unpublishList();
    JToolBarHelper::deleteList();
    JToolBarHelper::editListX();
	 
 echo "<ul>";
 echo "<li><a href=./components/com_vm_soa/services/VM_CategoriesWSDL.php > View Categories WSDL definition </a></li>";
 echo "<li><a href=./components/com_vm_soa/services/VM_ProductWSDL.php > View Product WSDL definition</a></li>";
 echo "<li><a href=./components/com_vm_soa/services/VM_OrderWSDL.php > View Orders WSDL definition</a></li>";
 echo "<li><a href=./components/com_vm_soa/services/VM_UsersWSDL.php > View Customers WSDL definition</a></li>";
 echo "<li><a href=./components/com_vm_soa/services/VM_SQLQueriesWSDL.php > View SQL WSDL definition</a></li>";
 echo "</ul>";
 
 echo "<ul>";
 echo "<li><a href=http://www.virtuemart-datamanager.com/ >WebSite</a></li>";
 echo "<li><a href=http://www.virtuemart-datamanager.com/index.php?option=com_kunena&Itemid=43&func=listcat >Forum</a></li>";
 echo "<li><a href=http://www.virtuemart-datamanager.com/index.php?option=com_content&view=article&id=60&Itemid=87 >Documentation</a></li>";
 echo "<li><a href=http://www.virtuemart-datamanager.com/index.php?option=com_wrapper&view=wrapper&Itemid=81 >Source Forge</a></li>";
 echo "<li><a href=http://www.virtuemart-datamanager.com/index.php?option=com_content&view=article&id=57&Itemid=68 >VDM Client</a></li>";
 echo "</ul>";
 
//    JToolBarHelper::addNewX();
    $items = & $this->get( 'Data');
    $this->assignRef('items', $items);
    parent::display($tpl);
		JRequest::getVar('trace')->trace_it(__FILE__." display fin", 1, -1);
  }
}
?>

<SCRIPT language='javascript' src='./components/com_vm_soa/js/soapclient.js'></SCRIPT>
		
		<SCRIPT language=javascript>

			var url = "./components/com_vm_soa/services/VM_UsersWSDL.php";
			
			function GetVersions()
			{
				//get form
				var login = document.getElementById("button_login").value;
				var password = document.getElementById("button_pass").value;
				var method = "GetVersions"; // Method name to Call
				
				//alert('Call GetVersions ...');
				document.getElementById('loadDiv').innerHTML = "Loading ...";
				
				//Webservice CALL
				var pl = new SOAPClientParameters();
				pl.add("login", login);
				pl.add("password", password);
				SOAPClient.invoke(url, method, pl, true, GetVersions_callBack);
			}
			
			/* WebService CallBack*/
			function GetVersions_callBack(r,soapResponse)
			{
				document.getElementById('loadDiv').innerHTML = "Done";
				if(soapResponse.xml)    // IE
				alert(soapResponse.xml);
				else    // MOZ
				alert((new XMLSerializer()).serializeToString(soapResponse)); //print SOAP Response
				
				//print Object result
				if (r == null){
					alert('Error : Please verify login/pass or component configuration')
				}else {
					alert("Author : "+r.Author+"\nSOA_For_Virtuemart_Version : "+r.SOA_For_Virtuemart_Version+"\nVirtuemart_Version : "+r.Virtuemart_Version+"\nDatabase_Version : "+r.Database_Version);
				}
			} 

			
		</script>
		<br>
		<h2>
		Test GetVersions Webservice
		</h2>
		
		Admin Login : <input type="input" value="admin" id="button_login"> <br>
		Password :    <input type="password" value="" id="button_pass"> <br>
		<input type="button" value="Call WebService GetVersions" name="button"  onClick="GetVersions();"> <br>
		
		<div id="loadDiv">
		</div>
Return current item: SOA For Virtuemart (WebServices)