<?php

define("SERVICE_WSDL", "http://elecdistributiongearcctradingasefficientdata.dedicated.co.za/Service.asmx?wsdl");
//define("SERVICE_WSDL", "http://localhost:61460/Service.asmx?wsdl");

class SoapProxy {
		// Singleton instance
		private static $instance;
		
		public function __construct() {
			
			// Create a new SoapClient (see: http://se2.php.net/soap)
			$this->webService = new SoapClient(
				SERVICE_WSDL,
				array(
					"trace" => 1,
					"exceptions" => 1,
					"cache_wsdl" => WSDL_CACHE_NONE
				) 
			);
		}
		
		public function login($username,$password)
		{
			$p = new stdClass();
			$p->username = $username;
			$p->password = $password;
			$strXml = $this->webService->login2($p)->login2Result;
			echo json_encode($strXml);
		}
}

?>