php请求api获取返回值,我用curl请求接口获取返回值,但是不成功,大神给看看怎么调取?...
接口地址 http://mp.vservice.com.cn/service/OutWebService?wsdl
接口調(diào)用方
callService(String serviceName,String servId,String secretKey,String xmlInfo)
參數(shù)名稱 傳值
serviceName:OAuth
servId :服務(wù)號(hào)id
secretKey :服務(wù)號(hào)秘鑰
xmlInfo :
333
weixin/yixin
info/base
uri
這個(gè)是文檔內(nèi)容,服務(wù)號(hào)id和密鑰就不公布,大神們給指導(dǎo)下怎么用curl獲取返回值?
回復(fù)討論(解決方案)
怎么沒有人來回答
參考下http://blog.csdn.net/u011619326/article/details/38342421
用soap,不是用curl。
$servId = 'xxx';
$secretKey = 'xxx';
這兩處你改成你的賬號(hào)試試333weixin/yixininfo/baseuri'; $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo); var_dump($result);}catch(SOAPFault $e){ echo $e->getMessage(); } ?>
這個(gè)明明是webservice的調(diào)用,你為什么用curl
用SOAP獲取。
用soap,不是用curl。
$servId = 'xxx';
$secretKey = 'xxx';
這兩處你改成你的賬號(hào)試試333weixin/yixininfo/baseuri'; $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo); var_dump($result);}catch(SOAPFault $e){ echo $e->getMessage(); } ?>
非常感謝你,但是我運(yùn)行之后提示 Not enough message parts were received for the operation.
不知該如何解決?
用soap,不是用curl。
$servId = 'xxx';
$secretKey = 'xxx';
這兩處你改成你的賬號(hào)試試333weixin/yixininfo/baseuri'; $result = $client->callService($servicename, $servId, $secretKey, $xmlInfo); var_dump($result);}catch(SOAPFault $e){ echo $e->getMessage(); } ?>
非常感謝你,但是我運(yùn)行之后提示 Not enough message parts were received for the operation.
不知該如何解決?
我是按你提供的參數(shù)做的,看了wsdl文檔發(fā)現(xiàn)少了些參數(shù)
按照我這個(gè)肯定好用,求分。try {$xml='xml數(shù)據(jù)';//地址$soap = new SoapClient ( "http://mp.vservice.com.cn/service/OutWebService?WSDL" );//請(qǐng)求參數(shù) 根據(jù)你的參數(shù)調(diào)整$param = array ('userName' => '*****', 'pwd' => '****', 'businessType' => 'SaleHouses', 'xmlContent' => $xml );//調(diào)用服務(wù)器端的方法 根據(jù)你的方法調(diào)整 我這里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
很感謝
本文原創(chuàng)發(fā)布php中文網(wǎng),轉(zhuǎn)載請(qǐng)注明出處,感謝您的尊重!
總結(jié)
以上是生活随笔為你收集整理的php请求api获取返回值,我用curl请求接口获取返回值,但是不成功,大神给看看怎么调取?...的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: C++三大继承与多级派生
- 下一篇: pcl里面的点特征直方图(PFH)