Home > Backend Development > PHP Tutorial > !php调用webservice出错

!php调用webservice出错

WBOY
Release: 2016-06-13 13:00:58
Original
1003 people have browsed it

求助!!!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 />
Copy after login


现在的返回信息是
错误 :wsdl error: phpType is struct, but value is not an array: see debug output for details 
请问高手如何解决!php调用webservice这两天刚研究。不是很懂!
------解决方案--------------------
<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>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template