接口地址 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中文网,转载请注明出处,感谢您的尊重!