php中如何用webservice得到数据,在线等 php页面中,如何把这个页面(http://www.jxmth.com/jxmthWebService.asmx )的房源列表数据得到:说明:这是一个接口页面(用到webservie),我现要通过这接口页面来得到房源列表。thanks 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 xml json啊等等 很简单,这样就能取得房源总数了,其他以此类推,参数信息,打印__getTypes,方法打印__getFunctions$client = new SoapClient('http://www.jxmth.com/jxmthWebService.asmx?wsdl');$res = $client->__soapCall('countFu', array('countFu' => array()));echo $res->countFuResult; <?phpheader("Content-Type: text/html;charset=utf-8"); require_once('../ini.php'); $objDB = dblink(); $path = "download.xml"; $param = array("page"=>1,"count"=>50); $client = new SoapClient("http://www.jxmth.com/jxmthWebService.asmx?WSDL",array('encoding'=>'UTF-8')); $result = $client->__call("mthFy",array("parameters"=>$param)); $rs = $result->mthFyResult->any; if(file_exists($path)){ file_put_contents($path,$rs); $xml = new DOMDocument(); $xml ->load($path); $table = $xml->getElementsByTagName("Table"); foreach($table as $list){ //echo $list->getElementsByTagName("shi_id")->item(0)->nodeValue; $row["PropertyNo"] = $list->getElementsByTagName("shi_id")->item(0)->nodeValue; $row["DistrictName"] = $list->getElementsByTagName("district")->item(0)->nodeValue; $row["Address"] = $list->getElementsByTagName("shi_name")->item(0)->nodeValue; $row["Floor"] = $list->getElementsByTagName("build_floor")->item(0)->nodeValue; $row["FloorAll"] = $list->getElementsByTagName("build_levels")->item(0)->nodeValue; $row["CountF"] = $list->getElementsByTagName("form_bedroom")->item(0)->nodeValue; $row["CountT"] = $list->getElementsByTagName("form_foreroom")->item(0)->nodeValue; $row["CountW"] = $list->getElementsByTagName("form_toilet")->item(0)->nodeValue; $row["Square"] = $list->getElementsByTagName("build_area")->item(0)->nodeValue; $row["PriceUnit"] = $list->getElementsByTagName("unit_price")->item(0)->nodeValue; $row["Price"] = $list->getElementsByTagName("sum_price")->item(0)->nodeValue; $row["updateTime"]=date('Y-m-d H:i:s',strtotime($list->getElementsByTagName("update_date")->item(0)->nodeValue)); $row["CompleteYear"] = $list->getElementsByTagName("build_year")->item(0)->nodeValue; $row["PropertyDecoration"] = $list->getElementsByTagName("fitment")->item(0)->nodeValue; $row["Status"] = $list->getElementsByTagName("state")->item(0)->nodeValue; $row["housetype"] = $list->getElementsByTagName("housetype")->item(0)->nodeValue; $sql = "select count(*) as num from mth_Property WHERE PropertyNo = '".$row["PropertyNo"]."'"; $objDB->execute($sql); $rs = $objDB->fetch_array(); if($rs['num']=="0") { //СÇøÐÅÏ¢²»È« $DistrictName=iconv("UTF-8", "GBK", $row["DistrictName"]); $Status=iconv("UTF-8", "GBK", $row["Status"]); $CompleteYear=iconv("UTF-8", "GBK", $row["CompleteYear"]); $CompleteYear = str_replace("Äê´ú","",$CompleteYear); if(strlen($CompleteYear)<=2 && $CompleteYear) { $CompleteYear = '19'.$CompleteYear; } $PropertyDecoration=iconv("UTF-8", "GBK", $row["PropertyDecoration"]); $Address=iconv("UTF-8", "GBK", $row["Address"]); // $housetype=iconv("UTF-8", "GBK", $row["housetype"]); $sql = "insert into mth_Property set CityName='Äϲý',DistrictName='".$DistrictName."', EstateID='',Floor='".$row['Floor']."',FloorAll='".$row["FloorAll"]."',Trade='³öÊÛ',Status='".$Status."',CountF='".$row['CountF']."',CountT='".$row["CountT"]."',CountW='".$row["CountW"]."',Square='".$row["Square"]."',PriceUnit='".$row["PriceUnit"]."',Price='".$row["Price"]."',updateTime='".$row["updateTime"]."',ModDate='".$row["updateTime"]."',CompleteYear='".$CompleteYear."',PropertyDecoration='".$PropertyDecoration."',PropertyNo='".$row["PropertyNo"]."', Address='".$Address."'"; echo $sql.'<br>'; $objDB->execute($sql); } $arr[] = $row; } print_r($arr); }?> 请教如何获取PHP页面中靠查询数据库后输出一个记录的表格中记录的状态? 请问怎么从一个表中随机显示一条数据? php 加法怎么做? zend stud...脚本发生错误 这个引号里面显示变量的问题 如何知道文件是用什么编码? 关于路径的表示法,不清楚.... 100分求PHP+Mysql二级联动菜单 如何进行字符串形式保存的计算公式计算 这是什么原因? 40分求一段简单的分页代码,立即结帖!! 如何根据一年中的第几周 得到 这周的每个日期
$res = $client->__soapCall('countFu', array('countFu' => array()));
echo $res->countFuResult;
require_once('../ini.php');
$objDB = dblink();
$path = "download.xml";
$param = array("page"=>1,"count"=>50);
$client = new SoapClient("http://www.jxmth.com/jxmthWebService.asmx?WSDL",array('encoding'=>'UTF-8'));
$result = $client->__call("mthFy",array("parameters"=>$param));
$rs = $result->mthFyResult->any;
if(file_exists($path)){
file_put_contents($path,$rs);
$xml = new DOMDocument();
$xml ->load($path);
$table = $xml->getElementsByTagName("Table");
foreach($table as $list){
//echo $list->getElementsByTagName("shi_id")->item(0)->nodeValue;
$row["PropertyNo"] = $list->getElementsByTagName("shi_id")->item(0)->nodeValue;
$row["DistrictName"] = $list->getElementsByTagName("district")->item(0)->nodeValue;
$row["Address"] = $list->getElementsByTagName("shi_name")->item(0)->nodeValue;
$row["Floor"] = $list->getElementsByTagName("build_floor")->item(0)->nodeValue;
$row["FloorAll"] = $list->getElementsByTagName("build_levels")->item(0)->nodeValue;
$row["CountF"] = $list->getElementsByTagName("form_bedroom")->item(0)->nodeValue;
$row["CountT"] = $list->getElementsByTagName("form_foreroom")->item(0)->nodeValue;
$row["CountW"] = $list->getElementsByTagName("form_toilet")->item(0)->nodeValue;
$row["Square"] = $list->getElementsByTagName("build_area")->item(0)->nodeValue;
$row["PriceUnit"] = $list->getElementsByTagName("unit_price")->item(0)->nodeValue;
$row["Price"] = $list->getElementsByTagName("sum_price")->item(0)->nodeValue;
$row["updateTime"]=date('Y-m-d H:i:s',strtotime($list->getElementsByTagName("update_date")->item(0)->nodeValue));
$row["CompleteYear"] = $list->getElementsByTagName("build_year")->item(0)->nodeValue;
$row["PropertyDecoration"] = $list->getElementsByTagName("fitment")->item(0)->nodeValue;
$row["Status"] = $list->getElementsByTagName("state")->item(0)->nodeValue;
$row["housetype"] = $list->getElementsByTagName("housetype")->item(0)->nodeValue;
$sql = "select count(*) as num from mth_Property WHERE PropertyNo = '".$row["PropertyNo"]."'";
$objDB->execute($sql);
$rs = $objDB->fetch_array();
if($rs['num']=="0")
{
//СÇøÐÅÏ¢²»È«
$DistrictName=iconv("UTF-8", "GBK", $row["DistrictName"]);
$Status=iconv("UTF-8", "GBK", $row["Status"]);
$CompleteYear=iconv("UTF-8", "GBK", $row["CompleteYear"]);
$CompleteYear = str_replace("Äê´ú","",$CompleteYear);
if(strlen($CompleteYear)<=2 && $CompleteYear)
{
$CompleteYear = '19'.$CompleteYear;
}
$PropertyDecoration=iconv("UTF-8", "GBK", $row["PropertyDecoration"]);
$Address=iconv("UTF-8", "GBK", $row["Address"]);
// $housetype=iconv("UTF-8", "GBK", $row["housetype"]);
$sql = "insert into mth_Property set CityName='Äϲý',DistrictName='".$DistrictName."', EstateID='',Floor='".$row['Floor']."',FloorAll='".$row["FloorAll"]."',Trade='³öÊÛ',Status='".$Status."',CountF='".$row['CountF']."',CountT='".$row["CountT"]."',CountW='".$row["CountW"]."',Square='".$row["Square"]."',PriceUnit='".$row["PriceUnit"]."',Price='".$row["Price"]."',updateTime='".$row["updateTime"]."',ModDate='".$row["updateTime"]."',CompleteYear='".$CompleteYear."',PropertyDecoration='".$PropertyDecoration."',PropertyNo='".$row["PropertyNo"]."', Address='".$Address."'";
echo $sql.'<br>';
$objDB->execute($sql);
}
$arr[] = $row;
}
print_r($arr);
}
?>