PHP calls the WEBSERVICE interface and passes parameters

Source: Internet
Author: User
Hello, PHP calls the WEBSERVICE interface and passes parameters. I encountered this problem. when I call websevice, the port can be linked successfully, but it is always displayed.
Error: soap: Client: The request element was not recognized. how can I solve this problem?
$ Json = '{"Request": {"Header": {"IFCode": "interface ID", "CorpCode": "Customer Code", "SysCode ": "KongRun_BasicCode", "Account": "Account", "Pwd": "password"}, "Body": {"Integral": "10", "MobilePhone ": "Mobile phone number" }}'; $ obj = json_decode ($ json); print_r ($ obj); // $ param = array ('lelephone' => $ MobilePhone, 'integral' => $ Integral); $ result = $ client-> call ('ductionintegral', array ('parameters '=> $ obj )); // print_r ($ param );

Is the code wrong? ???


Reply to discussion (solution)

Have you ever encountered such a problem?

Without seeing the WSDL, you cannot determine what the DeductionIntegral parameter should be like.
However, there is a principle that must be observed:
$ Client-> DeductionIntegral ($ param)
Then you need to use the call method to access $ client-> call ('ductionintegral', array ($ param ))
That is, the parameter should be placed in the array because it calls the call_user_func_array function internally.

Without seeing the WSDL, you cannot determine what the DeductionIntegral parameter should be like.
However, there is a principle that must be observed:
$ Client-> DeductionIntegral ($ param)
Then you need to use the call method to access $ client-> call ('ductionintegral', array ($ param ))
That is, the parameter should be placed in the array, because it calls the call_user_func_array function http://hr.pim-cs.com/WebService/IntegralInterface.asmx internally? In wsdl, I directly use $ client-> call ('ductionintegral', array ($ obj). the error message is the same. I don't understand it!

Without seeing the WSDL, you cannot determine what the DeductionIntegral parameter should be like.
However, there is a principle that must be observed:
$ Client-> DeductionIntegral ($ param)
Then you need to use the call method to access $ client-> call ('ductionintegral', array ($ param ))
That is, the parameter should be placed in the array because it calls the call_user_func_array function internally.
The display parameter is incorrectly passed in. I want to ask, is this correct?
$ Json = '{"Request": {"Header": {"IFCode": "interface ID", "CorpCode": "Customer Code", "SysCode ": "KongRun_BasicCode", "Account": "Account", "Pwd": "password"}, "Body": {"Integral": "10", "MobilePhone ": "Mobile phone number" }}'; $ obj = json_decode ($ json); print_r ($ obj); // $ param = array ('lelephone' => $ MobilePhone, 'integral' => $ Integral); $ result = $ client-> call ('ductionintegral', array ('parameters '=> $ obj ));

He provides two methods in total.
[0] => DeductionIntegralResponse DeductionIntegral (DeductionIntegral $ parameters)
[1] => MemberAddIntegralResponse MemberAddIntegral (MemberAddIntegral $ parameters)
The DeductionIntegral method requires a data of the DeductionIntegral type as a parameter.

The DeductionIntegral type is described as follows:
Struct DeductionIntegral {
String Json;
}
So we should call
$ Param = array ('json' => $ Json );

$ Client-> call ('ductionintegral', array ($ param ));
Or
$ Client-> DeductionIntegral ($ param );

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.