Help !!! An error occurred while calling webservice in php! $ Client & nbsp ;=& nbsp; new & nbsp; soapclient ('http: // www.tuc365.cn/SPINTERFACE.asmx? Wsdl ', & nbsp; true); $ fromcity = $ _ POST [txtCity]; & nbsp; & help !!! An error occurred while calling webservice in php!
$ 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
$ ClientPhone =$ _ POST [clientPhone]; // passenger's phone number
$ ClientType = $ _ POST [clientType]; // passenger type
$ Webname = "51pingo.com"; // website name
$ FilghtId = $ _ POST [$ filghtId]; // Flight id
$ LinkName = $ _ POST [txtLinkManName]; // contact name
$ LinkPhone = $ _ POST [txtLinkManPhone]; // contact phone number
$ LinkAddress = $ _ POST [txtLinkManAddress]; // contact number
$ LinkEmail =$ _ POST [txtLinkManEmail]; // contact email
$ WebOrderId = date ("YmdHis"); // Generate the order number
$ 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 "program return:", htmlentities ($ str, ENT_QUOTES );
} Else {
Echo "error:", htmlentities ($ err, ENT_QUOTES );
}
The returned information is
Error: wsdl error: phpType is struct, but value is not an array: see debug output for details
How can I solve this problem! Php has been calling webservice for the past two days. Not very familiar!
------ Solution --------------------
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"=>"",