且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

PHP &SoapClient:SOAP 请求中缺少参数

更新时间:2023-02-23 09:56:03

在这种情况下,我发现我发送的参数与 Web 服务代码中的参数命名不完全相同.通过更改以上内容:

In this case, I discovered that the parameter I was sending was not named exactly as the parameter in the Web Service code. By changing the above:

array('GetData'=> array('parameters'=> 'Hello')),

到:

array('GetData'=> array('value'=> 'Hello')),

调用正常,参数不再为空!我不知道这种行为是否是这种情况所独有的,但以我有限的经验,我还没有看到另一端的参数命名很重要的情况.

the call worked normally and the parameter was no longer blank! I don;t know if this behavior is unique to this situation, but in my limited experience, I have not seen a situation where it mattered what the parameter was named on the other end.

无论如何,问题已经解决了.希望这对某人有所帮助!

At any rate, issue is solved. Hope this helps someone!