Interface-how does php call the wcf service? the call parameter is an object parameter.

Source: Internet
Author: User
. Net provides the wcf interface, which can be accessed by deploying IIS! Response) I use phpsoap to call and test whether it can be used. it is also possible: __getfunctions (); echo & quot; related data structure n & quot ;; print_r ($ c interface php parameter

The. net-based wcf interface can be accessed by deploying IIS.

I use php soap to call and test whether it can be passed. it is also possible:
Header ('content-Type: text/plain ');
$ Client = new SoapClient ('http: // testu.sh.jinri.com/Flight.User.SOA/SuggestService.svc? Wsdl ');
Echo'

';
Echo "provided Method \ n ";
Print_r ($ client-> GetFunctions ());
Echo "related data structure \ n ";
Print_r ($ client->
GetTypes ());
Echo '';
?>
Result displayed on the browser

Call this method in wcf: GetSuggestList
This method is like this in the interface:
Public GetSuggestListResponse GetSuggestList (GetSuggestListRequest request)
So the parameter is an object.
My PHP call is as follows:
$ Client = new SoapClient ('http: // testu.sh.jinri.com/Flight.User.SOA/SuggestService.svc? Wsdl ');
$ Param = array ('userid' => '2013', 'pageindex' => '1', 'pagesize' => '5 ');
Print_r ($ client-> GetSuggestList ($ param ));
However, this error is thrown:
Fatal error: Uncaught SoapFault exception: [a: InternalServiceFault] The object reference is not set to the instance of the object. In D: \ APMServ5.2.6 \ www \ htdocs \ wsdltest \ index. php: 22 Stack trace: #0 [internal function]: SoapClient->__ call ('getsuggestlist', Array) #1 D: \ APMServ5.2.6 \ www \ htdocs \ wsdltest \ index. php (22): SoapClient-> GetSuggestList (Array) #2 {main} thrown inD: \ APMServ5.2.6 \ www \ htdocs \ wsdltest \ index. php on line 22

Please help me. it's been a whole day and I don't know why.

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.