我有下面的 php webservice 代码,我想做什么,这样我就可以在 java 中调用这个 web 服务。我需要先生成wsdl吗?然后用 wsdl 生成 java web 服务存根?我怎么能在java中调用它。以及我需要使用什么工具。谢谢你。
<?php include_once("../../lib/config.php"); ?>
<?php
if(!extension_loaded("soap")){
dl("php_soap.dll");
}
ini_set("soap.wsdl_cache_enabled","0");
$server = new SoapServer("membersearch.wsdl");
function doMyMemberSearch($membernumber){
$sqlMemberInfo = mysql_query("SELECT * FROM Member_Info WHERE Member_Number = '".$membernumber."'");
$rowMemberInfo = mysql_fetch_array($sqlMemberInfo);
$arr[] = array(
"anniversary" => $rowMemberInfo['Anniversary'],
"club" => $rowMemberInfo['Club'],
"level"=> $rowMemberInfo['Level'],
"delivery"=> $rowMemberInfo['Delivery'],
"firstname"=> $rowMemberInfo['First_Name'],
"lastname"=> $rowMemberInfo['Last_Name'],
"birthday"=> $rowMemberInfo['Birthday'],
"spousefirst"=> $rowMemberInfo['Spouse_First'],
"spouselast"=> $rowMemberInfo['Spouse_Last'],
"spousebirthday"=> $rowMemberInfo['Spouse_Birthday'],
"signuploc"=> $rowMemberInfo['Signup_Loc'],
"status"=> $rowMemberInfo['Status']
);
if (isset($rowMemberInfo['Anniversary'])) {
return $arr;
}else {
throw new SoapFault("Server","Unknown Member Number '$membernumber'.");
}
}
$server->AddFunction("doMyMemberSearch");
$server->handle();
?>