{"id":148,"date":"2013-08-13T00:00:00","date_gmt":"2013-08-12T15:00:00","guid":{"rendered":"https:\/\/jikoman.sin-cos.com\/blog\/?p=148"},"modified":"2013-08-13T00:00:00","modified_gmt":"2013-08-12T15:00:00","slug":"awssoap","status":"publish","type":"post","link":"https:\/\/jikoman.sin-cos.com\/blog\/2013\/08\/awssoap\/","title":{"rendered":"AWS\u306e\u8a8d\u8a3c\u5bfe\u7b56(SOAP)"},"content":{"rendered":"<div class=\"tr_bq\">\n\u3088\u3046\u3084\u304fAWS\u306e\u8a8d\u8a3c\u5bfe\u7b56\u3092\u884c\u3063\u305f\u306e\u3067\u3001\u30e1\u30e2\u3002<\/div>\n<p>\u307e\u305a\u3001SOAP\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u6b21\u306e\u30da\u30fc\u30b8\u306e\u8aac\u660e\u3092\u8aad\u3080\u3002<br \/>\n<a href=\"https:\/\/portal.aws.amazon.com\/gp\/aws\/securityCredentials\" target=\"_blank\">https:\/\/portal.aws.amazon.com\/gp\/aws\/securityCredentials<\/a><br \/>\n\u6614\u4f7f\u3063\u3066\u3044\u305f<b>\u30b5\u30d6\u30b9\u30af\u30ea\u30d7\u30b7\u30e7\u30f3ID<\/b>\u306f\u3001<b>\u30a2\u30af\u30bb\u30b9\u30ad\u30fc ID<\/b>\u306b\u306a\u3063\u3066\u3044\u308b\u3002<br \/>\n\u3055\u3089\u306b\u3001\u8a8d\u8a3c\u306e\u9375\u3068\u306a\u308b<b>\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc<\/b>\u304c\u5fc5\u8981\u306a\u306e\u3067\u3001\u6b21\u306e\u30da\u30fc\u30b8\u3067\u8abf\u3079\u308b\u3002<br \/>\n<a href=\"https:\/\/images-na.ssl-images-amazon.com\/images\/G\/09\/associates\/paapi\/dg\/index.html\" target=\"_blank\">https:\/\/images-na.ssl-images-<\/a><br \/>\n<a href=\"https:\/\/images-na.ssl-images-amazon.com\/images\/G\/09\/associates\/paapi\/dg\/index.html\" target=\"_blank\">amazon.com\/images\/G\/09\/associates\/paapi\/dg\/index.html<\/a><br \/>\n\u3055\u3066\u3001\u30b3\u30fc\u30c9\u306e\u5909\u66f4\u3002<\/p>\n<p>\/\/ \u5b9a\u6570\u5b9a\u7fa9<br \/>\ndefine(&#8220;ACCESS_KEY&#8221;,<b>[\u30a2\u30af\u30bb\u30b9\u30ad\u30fc ID]<\/b>);<br \/>\ndefine(&#8220;SECRET_KEY&#8221;,<b>[\u30b7\u30fc\u30af\u30ec\u30c3\u30c8\u30a2\u30af\u30bb\u30b9\u30ad\u30fc]<\/b>); \/\/ \u3053\u3053\u8ffd\u52a0<br \/>\ndefine(&#8220;ASSOCIATE_TAG&#8221;,<b>[Amazon\u30a2\u30bd\u30b7\u30a8\u30a4\u30c8\u306e\u30c8\u30e9\u30c3\u30ad\u30f3\u30b0ID]<\/b>);<br \/>\n\/\/ \u7f72\u540d\u4f5c\u6210\u3000\u3053\u3053\u3082\u8ffd\u52a0<br \/>\n$timeStamp = gmdate(&#8220;Y-m-dTH:i:sZ&#8221;); \/\/&nbsp;\u56fd\u969b\u6a19\u6e96\u6642<br \/>\n$function = &#8220;ItemSearch&#8221;; \/\/ \u51e6\u7406\u306e\u30bf\u30a4\u30d7<br \/>\n$signature = base64_encode(hash_hmac(&#8220;sha256&#8221;, ($function.$timeStamp), SECRET_KEY, True)); \/\/ \u3053\u308c\u304c\u7f72\u540d<\/p>\n<p>$client = new SoapClient(&#8216;http:\/\/webservices.amazon.com\/AWSECommerceService\/AWSECommerceService.wsdl&#8217;);<\/p>\n<p>$params = array(<br \/>\n \/\/&#8221;AWSAccessKeyId&#8221; =&gt; ACCESSKEY_ID, \/\/ \u30d8\u30c3\u30c0\u306b\u5165\u308c\u308b\u306e\u3067\u4e0d\u8981<br \/>\n &#8220;AssociateTag&#8221;=&gt;ASSOCIATE_TAG,<br \/>\n &#8220;Request&#8221;=&gt;array(&#8220;ItemId&#8221;=&gt;&#8221;4480037969&#8243;,&#8221;IdType&#8221;=&gt;&#8221;ASIN&#8221;,&#8217;ResponseGroup&#8217;=&gt;&#8217;Medium,Images&#8217;)<br \/>\n);<br \/>\n\/\/ \u30d8\u30c3\u30c0\u3092\u8ffd\u52a0<br \/>\n$namespace = &#8216;http:\/\/security.amazonaws.com\/doc\/2007-01-01\/&#8217;;<br \/>\n$header_data = array(<br \/>\n&nbsp; &#8216;AWSAccessKeyId&#8217; =&gt;&nbsp;ACCESS_KEY,<br \/>\n&nbsp; &#8216;Timestamp&#8217; =&gt; $timeStamp,<br \/>\n&nbsp; &#8216;Signature&#8217; =&gt; $signature,<br \/>\n);<br \/>\n$header_arr&nbsp;= array();<br \/>\nforeach ($header_data as $name =&gt; $val) {<br \/>\n&nbsp; $header_arr[] = new SoapHeader($namespace, $name, $val);<br \/>\n}<br \/>\n$client-&gt;__setSoapHeaders($header_arr);<br \/>\n\/\/ \u5b9f\u884c<br \/>\n$result = $client-&gt;$function($params);<\/p>\n<div>\n\u3088\u3057\uff01<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u3088\u3046\u3084\u304fAWS\u306e\u8a8d\u8a3c\u5bfe\u7b56\u3092\u884c\u3063\u305f\u306e\u3067\u3001\u30e1\u30e2\u3002 \u307e\u305a\u3001SOAP\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u306e\u3067\u3001\u6b21\u306e\u30da\u30fc\u30b8\u306e\u8aac\u660e\u3092\u8aad\u3080\u3002 https:\/\/portal.aws.amazon.com\/gp\/aws\/securityCredentials  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[130],"tags":[],"class_list":["post-148","post","type-post","status-publish","format-standard","hentry","category-130"],"_links":{"self":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/comments?post=148"}],"version-history":[{"count":0,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/posts\/148\/revisions"}],"wp:attachment":[{"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/media?parent=148"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/categories?post=148"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jikoman.sin-cos.com\/blog\/wp-json\/wp\/v2\/tags?post=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}