php请求api获取返回值,我用curl请求接口获取返回值,但是不成功,大神给看看怎么调取?...

接口地址 http://mp.vservice.com.cn/service/OutWebService?wsdl

接口调用方

callService(String serviceName,String servId,String secretKey,String xmlInfo)

参数名称 传值

serviceName:OAuth

servId :服务号id

secretKey :服务号秘钥

xmlInfo :

333

weixin/yixin

info/base

uri

这个是文档内容,服务号id和密钥就不公布,大神们给指导下怎么用curl获取返回值?

回复讨论(解决方案)

怎么没有人来回答

参考下http://blog.csdn.net/u011619326/article/details/38342421

用soap,不是用curl。

$servId = 'xxx';

$secretKey = 'xxx';

這兩處你改成你的賬號試試333weixin/yixininfo/baseuri'; $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo); var_dump($result);}catch(SOAPFault $e){ echo $e->getMessage(); } ?>

这个明明是webservice的调用,你为什么用curl

用SOAP获取。

用soap,不是用curl。

$servId = 'xxx';

$secretKey = 'xxx';

這兩處你改成你的賬號試試333weixin/yixininfo/baseuri'; $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo); var_dump($result);}catch(SOAPFault $e){ echo $e->getMessage(); } ?>

非常感谢你,但是我运行之后提示 Not enough message parts were received for the operation.

不知该如何解决?

用soap,不是用curl。

$servId = 'xxx';

$secretKey = 'xxx';

這兩處你改成你的賬號試試333weixin/yixininfo/baseuri'; $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo); var_dump($result);}catch(SOAPFault $e){ echo $e->getMessage(); } ?>

非常感谢你,但是我运行之后提示 Not enough message parts were received for the operation.

不知该如何解决?

我是按你提供的参数做的,看了wsdl文档发现少了些参数

按照我这个肯定好用,求分。try {$xml='xml数据';//地址$soap = new SoapClient ( "http://mp.vservice.com.cn/service/OutWebService?WSDL" );//请求参数 根据你的参数调整$param = array ('userName' => '*****', 'pwd' => '****', 'businessType' => 'SaleHouses', 'xmlContent' => $xml );//调用服务器端的方法 根据你的方法调整 我这里Import是方法名称$result = $soap->__soapCall ( 'Import', array ('parameters' => $param ) );print_r ( $result );} catch ( SoapFault $e ) {echo $e->getMessage ();} catch ( Exception $E ) {echo $E->getMessage ();}

参考下http://blog.csdn.net/u011619326/article/details/38342421

很感谢

本文原创发布php中文网,转载请注明出处,感谢您的尊重!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值