class Member { public $UserId; public $Name; public function __construct($parmas){ $this->UserId = $parmas[0]; $this->Name = $parmas[1]; } } $servidorSoap = new SoapServer('testphp.xml',array('uri' => 'http://www.TestPHP.com/','encoding'=>'utf-8','soap_version' => SOAP_1_2 )); $servidorSoap->setClass(Testphp); $servidorSoap->handle(); class Testphp { public function HelloWorld($uid){ return array('HelloWorldResult'=>"mystring".$uid->{'uname'}.' and '.$uid->{'upassword'}); } public function GetMember($uid){ $s=array(); for($i=0;$i{'uid'};$i++){ $s[] =&new Member(array($i, $uid->{'uname'}.'我测试'.$i)); } return array('GetMemberResult'=>$s); } } ?>
|