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 );