我用curl請求介面擷取傳回值,但是不成功,大神給看看怎麼調取?

來源:互聯網
上載者:User
介面地址 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


很感謝
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.