Maison > Article > développement back-end > !php调用webservice出错
求助!!!php调用webservice出错!
<br /> $client = new soapclient('http://www.tuc365.cn/SPINTERFACE.asmx?wsdl', true);<br /> <br /> $fromcity=$_POST[txtCity]; //出发城市<br /> $tocity=$_POST[txtCity0]; //抵达城市<br /> $fromdate=$_POST[fromdate]; //出发时间<br /> $roles=$_POST[roles]; //是否返回<br /> $returnDate=$_POST[returnDate]; //返回时间<br /> $userName=$_POST[username]; //用户名<br /> $clientName=$_POST[clientName]; //乘客姓名<br /> $clientCardId=$_POST[clientCardid]; //乘客证件号<br /> $clientPhone=$_POST[clientPhone]; //乘客电话<br /> $clientType=$_POST[clientType]; //乘客类型<br /> $webname="51pingo.com"; //网站名称<br /> $filghtId=$_POST[$filghtId]; //航班id <br /> $linkName=$_POST[txtLinkManName]; //联系人姓名 <br /> $linkPhone=$_POST[txtLinkManPhone]; //联系人电话<br /> $linkAddress=$_POST[txtLinkManAddress]; //联系人电话<br /> $linkEmail=$_POST[txtLinkManEmail]; //联系人email<br /> $webOrderId=date("YmdHis"); //生成订单号<br /> $webUserName="tuc365";<br /> $webmd5="tuc365";<br /> <br /> $orderInfo=array($fromcity,$tocity,$fromdate,$roles,$returnDate,$userName,$clientName,$clientCardId,$clientPhone,$clientType,$webname,$filghtId,$linkName,$linkPhone,$linkAddress,$linkEmail,$webOrderId,$webUserName,$webmd5);<br /> $str=$client->call('AddOrders',$orderInfo);<br /> if (!$err=$client->getError()) {<br /> echo "程序返回:",htmlentities($str,ENT_QUOTES);<br /> } else {<br /> echo "错误 :",htmlentities($err,ENT_QUOTES);<br /> }<br />
<br>
<?php <br />
header("Content-Type: text/html;charset=utf-8");<br>
$client = new SoapClient('http://www.tuc365.cn/SPINTERFACE.asmx?wsdl');<br>
<br>
//GetFlight<br>
$aData = array('webName'=>'','webUserName'=>'','webmd5'=>'tuc365');<br>
$aResult = $client->__call('GetFlight',$aData);<br>
<br>
//AddOrders <br>
/*$aData = array(<br>
"fromCity"=>"", <br>
"toCity"=>"", <br>
"fromDate"=>"", <br>
"returnDate"=>"", <br>
"roles"=>"", <br>
"userName"=>"", <br>
"clientName"=>"", <br>
"clientCardId"=>"", <br>
"clientPhone"=>"", <br>
"clientType"=>"", <br>
"webName"=>"", <br>
"flightId"=>"", <br>
"linkName"=>"", <br>
"linkPhone"=>"", <br>
"linkAddress"=>"", <div class="clear">
</div>