PHP怎么请求soap。其中要调用的那个方法的参数是这个方法的对象参数。到底该怎么调用。 PHPsoap 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你用 __getTypes 方法就可以得到 Pay 结构的描述php 没有结构这个数据类型,所以要用关联数组来替代 比如$client = new SOAPClient("http://v2.shanxitele.com/service/OutWebService?wsdl", array('uri' => "http://v2.shanxitele.com/"));print_r($client->__getfunctions());print_r($client->__gettypes());Array( [0] => callServiceResponse callService(callService $parameters))Array( [0] => struct callService { string in0; string in1; string in2; string in3;} [1] => struct callServiceResponse { string out;})可知方法 callService 需要一个 callService 类型的结构作为参数而 struct callService 是由 in0、in1、in2、in3 四个成员组成的如果有定义$data = array( 'in0' => 'OAuth', 'in1' => 'fc4fa30c444400b701446c540230244e', 'in2' => '96e79218965eb72c92a549dd5a330112', 'in3' => '<?xml version="1.0" encoding="UTF-8"?><BaseInfo><servId>fc4fa30c444400b701446c540230244e</servId><platform>yixin</platform><type>base</type><redirect_uri>lcoalhost/index.php</redirect_uri></BaseInfo>');则$result = $client->callService($data);echo $result->out;就可得到这样的结果<Result><BaseInfo><SERVID><![CDATA[fc4fa30c444400b701446c540230244e]]></SERVID><URL><![CDATA[http://open.plus.yixin.im/connect/oauth2/authorize?appid=dcb33a61567e462b9928b814200c76d6&redirect_uri=http%3A%2F%2Fv2.shanxitele.com%2F%2Fservlet%2FOAuthServlet&response_type=code&scope=snsapi_base&state=fc4fa30c444400b701446c540230244e_yixin_ff80808147b48cb30147d21ceeb34922]]></URL></BaseInfo></Result>为什么是 $result->out 而不是其他呢?因为 callService 返回名为 callServiceResponse 的结构,而 callServiceResponse 结构的成员只有 out 一人 thinkphp 表单令牌错误 php数组问题求助 php结果处理 求一个word 插件 json_encode 中文的数据冗余似乎很严重 linux(red hat)系统下无法建立文件夹(mkdir()没被禁用) 修改一下 PHP 代码, 用于POST 文本数据 请大家看一下这个是什么原因造成的? 请大家帮忙,功能实现后给600分!!!! 各位大神 求解决 Linux 下 LAMP 环境搭建 扩展编译 初学php,请问文章(不是页面)对应的页面的哪个?预览文章时总是跳到首页 Basic 认证的疑惑
php 没有结构这个数据类型,所以要用关联数组来替代
print_r($client->__getfunctions());
print_r($client->__gettypes());
Array
(
[0] => callServiceResponse callService(callService $parameters)
)
Array
(
[0] => struct callService {
string in0;
string in1;
string in2;
string in3;
}
[1] => struct callServiceResponse {
string out;
}
)可知方法 callService 需要一个 callService 类型的结构作为参数
而 struct callService 是由 in0、in1、in2、in3 四个成员组成的
如果有定义$data = array(
'in0' => 'OAuth',
'in1' => 'fc4fa30c444400b701446c540230244e',
'in2' => '96e79218965eb72c92a549dd5a330112',
'in3' => '<?xml version="1.0" encoding="UTF-8"?><BaseInfo><servId>fc4fa30c444400b701446c540230244e</servId><platform>yixin</platform><type>base</type><redirect_uri>lcoalhost/index.php</redirect_uri></BaseInfo>'
);则$result = $client->callService($data);
echo $result->out;
就可得到这样的结果<Result><BaseInfo><SERVID><![CDATA[fc4fa30c444400b701446c540230244e]]></SERVID><URL><![CDATA[http://open.plus.yixin.im/connect/oauth2/authorize?appid=dcb33a61567e462b9928b814200c76d6&redirect_uri=http%3A%2F%2Fv2.shanxitele.com%2F%2Fservlet%2FOAuthServlet&response_type=code&scope=snsapi_base&state=fc4fa30c444400b701446c540230244e_yixin_ff80808147b48cb30147d21ceeb34922]]></URL></BaseInfo></Result>
为什么是 $result->out 而不是其他呢?
因为 callService 返回名为 callServiceResponse 的结构,而 callServiceResponse 结构的成员只有 out 一人