{"id":551,"date":"2020-05-27T11:44:55","date_gmt":"2020-05-27T11:44:55","guid":{"rendered":"ae3c1689dafe47ae8cb56c7854a3ebae"},"modified":"2020-05-27T11:44:55","modified_gmt":"2020-05-27T11:44:55","slug":"ae3c1689dafe47ae8cb56c7854a3ebae","status":"publish","type":"post","link":"https:\/\/www.netnewpower.net\/?p=551","title":{"rendered":"Magento 1.9.x\u5b89\u88c5\u90e8\u7f72\u548cAPI\u6743\u9650\u5f00\u542f\u4f7f\u7528\u6559\u7a0b"},"content":{"rendered":"<p>1\u3001\u89e3\u538b\u7f29\u5b89\u88c5\u5305\u5230\u6839\u76ee\u5f55<br \/>\nhttp:\/\/localhost\/<\/p>\n<p>2\u3001\u5efa\u7acb\u6570\u636e\u5e93\uff0c\u6267\u884c\u5efa\u5e93\u811a\u672c<br \/>\nmagento1924.sql<\/p>\n<p>3\u3001\u6570\u636e\u5e93\u914d\u7f6e<br \/>\n\\app\\etc\\config.xml<br \/>\n\\app\\etc\\local.xml<br \/>\n\u8fd9\u91cc\u7684frontName\u662f\u540e\u53f0\u8def\u5f84<\/p>\n<p>4\u3001\u8bbe\u7f6e\u7f51\u7ad9\u5730\u5740<br \/>\n\u6570\u636e\u5e93\u8868core_config_data<br \/>\nweb\/unsecure\/base_url=&gt;http:\/\/localhost\/<br \/>\nweb\/secure\/base_url=&gt;http:\/\/localhost\/<\/p>\n<p>5\u3001\u8bbe\u7f6e\u7ba1\u7406\u5458\u5bc6\u7801\uff1a<br \/>\n\u6570\u636e\u5e93\u8868admin_user<\/p>\n<p>\u9ed8\u8ba4\u5bc6\u7801\uff08admin123\uff09\uff1a0192023a7bbd73250516f069df18b500<\/p>\n<p>\u767b\u5f55\u540e\u53f0\u7ba1\u7406\u540e\u53ef\u4ee5\u5230\uff1aSystem -&gt; my account\u4fee\u6539\u7ba1\u7406\u5458\u8d26\u6237\u4fe1\u606f\u548c\u5bc6\u7801\uff1b<\/p>\n<p>6\u3001\u5220\u9664\u7f13\u5b58\u6587\u4ef6\uff0c\u91cd\u542f\u7f51\u7ad9<br \/>\nvar\/cache<br \/>\nvar\/sessions<\/p>\n<p>7\u3001Magento API<br \/>\nAPI\u6587\u6863<br \/>\n<a href=\"https:\/\/devdocs.magento.com\/guides\/m1x\/api\/soap\/introduction.html\" target=\"_blank\" rel=\"noopener norefferrer\">https:\/\/devdocs.magento.com\/guides\/m1x\/api\/soap\/introduction.html<\/A><\/p>\n<p>\u89d2\u8272Role\u548c\u7528\u6237User<br \/>\nSystem\/Web Services\/Soap XML RPC\/Roles \u521b\u5efa\u89d2\u8272<br \/>\nSystem\/Web Services\/Soap XML RPC\/Users \u521b\u5efa\u89d2\u8272\u5bf9\u5e94\u7684\u7528\u6237\uff0c\u5e76\u4e14\u8bbe\u7f6eapi key<br \/>\n\u4f7f\u7528api user\u548capi key\u5c31\u53ef\u4ee5\u8bbf\u95eeMagento API<br \/>\n<a href=\"http:\/\/magentohost\/api\/soap\/?wsdl\" target=\"_blank\" rel=\"noopener norefferrer\">http:\/\/magentohost\/api\/soap\/?wsdl<\/A><br \/>\nnetnewpower<br \/>\ntestapikey<\/p>\n<p>\u4f8b\u5b50\uff1a<br \/>\n&lt;?php<br \/>\n$client = new SoapClient(&#8216;http:\/\/localhost\/api\/soap\/?wsdl&#8217;);<\/p>\n<p>\/\/ If somestuff requires API authentication,<br \/>\n\/\/ then get a session token<br \/>\n$session = $client-&gt;login(&#8216;netnewpower&#8217;, &#8216;testapikey&#8217;);<\/p>\n<p>$result = $client-&gt;call($session, &#8216;catalog_category.info&#8217;, &#8216;1&#8217;);<br \/>\necho &#8216;&lt;pre&gt;&#8217;;<br \/>\nprint_r($result);<\/p>\n<p>\/\/ If you don&#8217;t need the session anymore<br \/>\n$client-&gt;endSession($session);<br \/>\n?&gt;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u89e3\u538b\u7f29\u5b89\u88c5\u5305\u5230\u6839\u76ee\u5f55 http:\/\/localhost\/ 2\u3001\u5efa\u7acb\u6570\u636e\u5e93\uff0c\u6267\u884c\u5efa\u5e93\u811a\u672c mage<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[],"class_list":["post-551","post","type-post","status-publish","format-standard","hentry","category-25"],"_links":{"self":[{"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=\/wp\/v2\/posts\/551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=551"}],"version-history":[{"count":0,"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=\/wp\/v2\/posts\/551\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netnewpower.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}