All pastes #592046 Raw Edit

Anonymous

public php v1 · immutable
#592046 ·published 2007-06-27 15:25 UTC
rendered paste body
<?php    //var_dump($_SERVER['PHP_AUTH_USER']);    //var_dump($_SERVER['PHP_AUTH_PW']);    //exit;    ini_set('soap.wsdl_cache', '0');    ini_set('soap.wsdl_cache_limit', '0');    ini_set('soap.wsdl_cache_ttl', '0');    //show the wsdl = ?wsdl    if(isset($_GET['wsdl'])) {	header('Content-type: text/xml');	echo file_get_contents('man2.wsdl');	exit;    }        class UserObject {		var $id;	var $privs;		public function __construct($id, $data) {	    $this->id = $id;	    $this->username = "Random";	    $this->privs = $data;	    $this->privs['test'] = 'josh';	}	    }        class SoapRequest {		public function __construct($requestData) {	    //throw new Exception('help');	    $this->log($requestData);	    	}		public function SayHello($person) {	    	    if( !empty($person->name) && !empty($person->name2) ) {			        return "Sup Dog, ". $person->name ." ". $person->name2 ."!";			    } else {		$this->Error('Server','Invalid Params');	    }	}		public function GetUser($id) {	    	    $o = new UserObject($id, array(1,2,3));	    return $o;	    	}		private function log($data) {	    	    file_put_contents('log.log', $data , FILE_APPEND);	    	}		private function Error($type, $error) {	    	    throw new SoapFault($type, $error);	    	}	    }    $s = new SoapServer('http://localhost/~joshteam/Soap/man2.wsdl');        //timestamp & request to service    $log = date('m/j/y g:i:s').': '.file_get_contents('php://input');        $s->setClass('SoapRequest', $log);        $s->handle();    ?>