configureWSDL(“utknewswsdl”,”urn:utknewswsdl”);

$server->wsdl->addComplexType(
“groups”, “complextype”,
“struct”,
“all”,
“”,
array(“Id”=>array(“name”=>”Id”,”type”=>”xsd:interger”),
“userName”=>array(“name”=>”userName”,”type”=>”xsd:string”),
“administrator”=>array(“name”=>”administrator”,”type”=>”xsd:string”),
“announcer”=>array(“name”=>”announcer”,”type”=>”xsd:string”),
“audience”=>array(“name”=>”audience”,”type”=>”xsd:string”),));
$server->wsdl->addComplexType(
‘gdarray’,
‘complexType’,
‘array’,
‘all’,
‘SOAP-ENC:Array’,
array(),
array(array(‘ref’=>’SOAP-ENC:arrayType’,’wsdl:arrayType’=>’tns:groups[]’)),
‘tns:groups’);
$server->register(“authenUser”,
array(“username”=>”xsd:string”,”password”=>”xsd:string”,),
array(“return”=>”tns:groups”),
“urn:utknewswsdl”,
“urn:utknewswsdl/authenUser”,
“rpc”,
“encoded”,
“return data of product”);

function authenUser($username,$password)
{

$sql = “select Id,userName,administrator,announcer,audience from user “;
$sql .= “where userId ='”. $username.”‘ and password ='”.$password.”‘” ;
$sql .= “and userStatus ‘Delete’ ;”;
$rs = mysql_query($sql);
$rowNo = mysql_num_rows($rs);
if($rowNo == 0){
$rsAuthen = array();
}
else{
$rsAuthen = array();
$i=0;
while($data = mysql_fetch_array($rs)){
$rsAuthen[“Id”] = $data[0];
$rsAuthen[“userName”] = $data[1];
$rsAuthen[“administrator”] = $data[2];
$rsAuthen[“announcer”] = $data[3];
$rsAuthen[“audience”] = $data[4];
$i++;
}
}

return $rsAuthen;

}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)?$HTTP_RAW_POST_DATA: “”;
$server->service($HTTP_RAW_POST_DATA);

?>