|
|
|
ติดปัญหา php ดึงข้อมูลจาก xml (web service) ค่ะ |
|
|
|
|
|
|
|
ไม่ใช้ JSON ครับ อ่านได้ง่ายกกว่าครับ
|
|
|
|
|
Date :
2012-07-27 13:27:32 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยางไงค่ะ อธิบายหน่อยค่ะ
|
|
|
|
|
Date :
2012-07-27 13:42:07 |
By :
thitinun-bit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Code (PHP)
<html>
<head>
<title>ข้อมูลบุคลากร คณะบริหารธุรกิจ</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head>
<body>
<p>
<?
include("lib/nusoap.php");
$client = new nusoap_client("http://www.e-manage.mju.ac.th/service/projectService.asmx?wsdl",true);
$params = array(
'keyAuthentication' => "xx",
'governmentMainCode' => "xxxx"
);
$data = $client->call('projectOfDepartment',$params);
// $mydata = json_decode($data,true);
print_r($data);
$mydata = json_encode($data);
// echo $mydata;
if(count($mydata)==0){
echo "Not Data";
}else{
echo $mydata;
?>
<table width="500" border="1">
<tr>
<td>projectID</td>
<td>nameTh</td>
<td>departmentID</td>
</tr>
<?PHP
foreach($mydata as $result){
?>
<tr>
<td><?PHP echo $result["projectID"]?></td>
<td><?PHP echo $result["nameTh"]?></td>
<td><?PHP echo $result["departmentID"]?></td>
</tr>
<? }?>
</table>
<? }
?>
</p>
<p> </p>
</body>
</html>
ลองใส่แบบนี้ ไปแล้ว แต่ มัน ยาง Error อ่าค่ะ
ACode
rray ( [projectOfDepartmentResult] => Array ( [schema] => Array ( [element] => Array ( [complexType] => Array ( [choice] => Array ( [!minOccurs] => 0 [!maxOccurs] => unbounded ) ) [!name] => NewDataSet [!msdata:IsDataSet] => true [!msdata:UseCurrentLocale] => true ) [!id] => NewDataSet ) [diffgram] => ) ) {"projectOfDepartmentResult":{"schema":{"element":{"complexType":{"choice":{"!minOccurs":"0","!maxOccurs":"unbounded"}},"!name":"NewDataSet","!msdata:IsDataSet":"true","!msdata:UseCurrentLocale":"true"},"!id":"NewDataSet"},"diffgram":""}}
งง มากมายค่ะ
|
|
|
|
|
Date :
2012-08-14 09:54:08 |
By :
thitinun-bit |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|