<?php
  class Tickets_Service extends Controller
  {
  	public $server;
	public $namespace = 'http://new.networds.datatask.net/';
	
  	function Tickets_Service()
	{
		parent::Controller();
		require_once('files/nusoap/nusoap.php');	
		$this->server = new soap_server;
		$this->server->configureWSDL('tickectsWSDL', $this->namespace);
		$this->server->wsdl->schemaTargetNamespace = $this->namespace;	
		$this->server->soap_defencoding = 'UTF-8';
		//$this->server->decode_utf8 = false;
		$ini = ini_set("soap.wsdl_cache_enabled", 0);
		
	}
	function index($wsdl=null)
	{
		
        if($this->uri->segment(3) == "wsdl") {
            $_SERVER['QUERY_STRING'] = "wsdl";
        } else {
            $_SERVER['QUERY_STRING'] = "";
        }
        
		$this->server->register(
					    'hello_name',
					    array('name'=>'xsd:string'),
					    array('return'=>'xsd:string'),
					    $this->namespace);	
					    
		$this->server->register(
		               'admin_login',
		                array('login'=>'xsd:string','password'=>'xsd:string'),
		                array('return'=>'xsd:boolean'),
		                $this->namespace); 
	            
		function hello_name($name='world')
		{
		    return 'Hello '.$name;
		}

		function admin_login($login,$password)
		{
			return TRUE;
		}
		
        $this->server->service(file_get_contents("php://input"));
		//$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
		//$this->server->service(utf8_encode($HTTP_RAW_POST_DATA));
	}	

  }
?>