求助!!!php調用webservice出錯!
$client = new soapclient('http://www.tuc365.cn/SPINTERFACE.asmx?wsdl', true);
$fromcity=$_POST[txtCity]; //出發城市
$tocity=$_POST[txtCity0]; //抵達城市
$fromdate=$_POST[fromdate]; //出發時間
$roles=$_POST[roles]; //是否返回
$returnDate=$_POST[returnDate]; //返回時間
$userName=$_POST[username]; //使用者名稱
$clientName=$_POST[clientName]; //乘客姓名
$clientCardId=$_POST[clientCardid]; //乘客證件號
$clientPhone=$_POST[clientPhone]; //乘客電話
$clientType=$_POST[clientType]; //乘客類型
$webname="51pingo.com"; //網站名稱
$filghtId=$_POST[$filghtId]; //航班id
$linkName=$_POST[txtLinkManName]; //連絡人姓名
$linkPhone=$_POST[txtLinkManPhone]; //連絡人電話
$linkAddress=$_POST[txtLinkManAddress]; //連絡人電話
$linkEmail=$_POST[txtLinkManEmail]; //連絡人email
$webOrderId=date("YmdHis"); //產生訂單號
$webUserName="tuc365";
$webmd5="tuc365";
$orderInfo=array($fromcity,$tocity,$fromdate,$roles,$returnDate,$userName,$clientName,$clientCardId,$clientPhone,$clientType,$webname,$filghtId,$linkName,$linkPhone,$linkAddress,$linkEmail,$webOrderId,$webUserName,$webmd5);
$str=$client->call('AddOrders',$orderInfo);
if (!$err=$client->getError()) {
echo "程式返回:",htmlentities($str,ENT_QUOTES);
} else {
echo "錯誤 :",htmlentities($err,ENT_QUOTES);
}
現在的返回資訊是
錯誤 :wsdl error: phpType is struct, but value is not an array: see debug output for details
請問高手如何解決!php調用webservice這兩天剛研究。不是很懂!
------解決方案--------------------
header("Content-Type: text/html;charset=utf-8");
$client = new SoapClient('http://www.tuc365.cn/SPINTERFACE.asmx?wsdl');
//GetFlight
$aData = array('webName'=>'','webUserName'=>'','webmd5'=>'tuc365');
$aResult = $client->__call('GetFlight',$aData);
//AddOrders
/*$aData = array(
"fromCity"=>"",
"toCity"=>"",
"fromDate"=>"",
"returnDate"=>"",
"roles"=>"",
"userName"=>"",
"clientName"=>"",
"clientCardId"=>"",
"clientPhone"=>"",
"clientType"=>"",
"webName"=>"",
"flightId"=>"",
"linkName"=>"",
"linkPhone"=>"",
"linkAddress"=>"",