! An error occurred while calling webservice in php.

Source: Internet
Author: User
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"=>"", 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.