Help!!! PHP Call WebService Error!
$client = new SoapClient (' http://www.tuc365.cn/SPINTERFACE.asmx?wsdl ', true);
$fromcity =$_post[txtcity]; Departure City
$tocity =$_post[txtcity0]; Arrival City
$fromdate =$_post[fromdate]; Departure time
$roles =$_post[roles]; Whether to return
$returnDate =$_post[returndate]; Return time
$userName =$_post[username]; User name
$clientName =$_post[clientname]; Passenger Name
$clientCardId =$_post[clientcardid]; Passenger ID Number
$clientPhone =$_post[clientphone]; Passenger phone
$clientType =$_post[clienttype]; Passenger type
$webname = "51pingo.com"; Site name
$filghtId =$_post[$filghtId]; Flight ID
$linkName =$_post[txtlinkmanname]; Name of contact person
$linkPhone =$_post[txtlinkmanphone]; Contact phone
$linkAddress =$_post[txtlinkmanaddress]; Contact phone
$linkEmail =$_post[txtlinkmanemail]; Contact person Email
$webOrderId =date ("Ymdhis"); Generate Order Number
$webUserName = "tuc365";
$webmd 5= "tuc365";
erInfo =array ($fromcity, $tocity, $fromdate, $roles, $returnDate, $userName, $clientName, $clientCardId, $ Clientphone, $clientType, $webname, $filghtId, $linkName, $linkPhone, $linkAddress, $linkEmail, $webOrderId, $ Webusername, $webmd 5);
$str = $client->call (' addorders ', erInfo);
if (! $err = $client->geterror ()) {
echo "program returns:", Htmlentities ($str, ent_quotes);
} else {
echo "Error:", Htmlentities ($err, ent_quotes);
}
Now the return information is
Error: WSDL error:phptype is struct, but value was not a array:see debug output for details
Ask Master how to solve! PHP calls WebService these two days just to study. Not very understanding!
------Solution--------------------
!--? php
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" and "", "
" userName "+", "
" clientName "=" ","
"Clientcardid" and "",
"Clientphone" + "",
"ClientType" + "",
"WebName" and "", "
" flightid "=", "
" linkname "= > ",
" linkphone "=" ",
" linkaddress "=" ",