{"id":2652,"date":"2018-05-23T17:24:59","date_gmt":"2018-05-23T09:24:59","guid":{"rendered":"http:\/\/jason695.why3s.tw\/wordpress\/?p=2652"},"modified":"2018-05-23T17:25:44","modified_gmt":"2018-05-23T09:25:44","slug":"wcf%e3%80%81webapi%e3%80%81wcfrest%e3%80%81webservice%e4%b9%8b%e9%96%93%e7%9a%84%e5%8d%80%e5%88%a5","status":"publish","type":"post","link":"https:\/\/jason695.why3s.tw\/wordpress\/2018\/05\/23\/wcf%e3%80%81webapi%e3%80%81wcfrest%e3%80%81webservice%e4%b9%8b%e9%96%93%e7%9a%84%e5%8d%80%e5%88%a5\/","title":{"rendered":"WCF\u3001WebAPI\u3001WCFREST\u3001WebService\u4e4b\u9593\u7684\u5340\u5225"},"content":{"rendered":"<p>\u539f\u6587\u7db2\u5740\uff1ahttps:\/\/read01.com\/6GdOdP.html<\/p>\n<p>&nbsp;<\/p>\n<p>\u5728.net\u5e73\u53f0\u4e0b\uff0c\u6709\u5927\u91cf\u7684\u6280\u8853\u8b93\u4f60\u5275\u5efa\u4e00\u500bHTTP\u670d\u52d9\uff0c\u50cfWeb Service\uff0cWCF\uff0c\u73fe\u5728\u53c8\u51fa\u4e86Web API\u3002\u5728.net\u5e73\u53f0\u4e0b\uff0c\u4f60\u6709\u5f88\u591a\u7684\u9078\u64c7\u4f86\u69cb\u5efa\u4e00\u500bHTTP Services\u3002\u6211\u5206\u4eab\u4e00\u4e0b\u6211\u5c0dWeb Service\u3001WCF\u4ee5\u53caWeb API\u7684\u770b\u6cd5\u3002<\/p>\n<h3>Web Service<\/h3>\n<p>1\u3001\u5b83\u662f\u57fa\u65bcSOAP\u5354\u8b70\u7684\uff0c\u6578\u64da\u683c\u5f0f\u662fXML<\/p>\n<p>2\u3001\u53ea\u652f\u6301HTTP\u5354\u8b70<\/p>\n<p>3\u3001\u5b83\u4e0d\u662f\u958b\u6e90\u7684\uff0c\u4f46\u53ef\u4ee5\u88ab\u4efb\u610f\u4e00\u500b\u4e86\u89e3XML\u7684\u4eba\u4f7f\u7528<\/p>\n<p>4\u3001\u5b83\u53ea\u80fd\u90e8\u7f72\u5728IIS\u4e0a<\/p>\n<h3>WCF<\/h3>\n<p>1\u3001\u9019\u500b\u4e5f\u662f\u57fa\u65bcSOAP\u7684\uff0c\u6578\u64da\u683c\u5f0f\u662fXML<\/p>\n<p>2\u3001\u9019\u500b\u662fWeb Service\uff08ASMX\uff09\u7684\u9032\u5316\u7248\uff0c\u53ef\u4ee5\u652f\u6301\u5404\u7a2e\u5404\u6a23\u7684\u5354\u8b70\uff0c\u50cfTCP\uff0cHTTP\uff0cHTTPS\uff0cNamed Pipes, MSMQ.<\/p>\n<p>3\u3001WCF\u7684\u4e3b\u8981\u554f\u984c\u662f\uff0c\u5b83\u914d\u7f6e\u8d77\u4f86\u7279\u5225\u7684\u7e41\u7463<\/p>\n<p>4\u3001\u5b83\u4e0d\u662f\u958b\u6e90\u7684\uff0c\u4f46\u53ef\u4ee5\u88ab\u4efb\u610f\u4e00\u500b\u4e86\u89e3XML\u7684\u4eba\u4f7f\u7528<\/p>\n<p>5\u3001\u5b83\u53ef\u4ee5\u90e8\u7f72\u61c9\u7528\u7a0b\u5f0f\u4e2d\u6216\u8005IIS\u4e0a\u6216\u8005Windows\u670d\u52d9\u4e2d<\/p>\n<h3>WCF Rest<\/h3>\n<p>1\u3001\u60f3\u4f7f\u7528WCF Rest service\uff0c\u4f60\u5fc5\u9808\u5728WCF\u4e2d\u4f7f\u7528webHttpBindings<\/p>\n<p>2\u3001\u5b83\u5206\u5225\u7528[WebGet]\u548c[WebInvoke]\u5c6c\u6027\uff0c\u5be6\u73fe\u4e86HTTP\u7684GET\u548cPOST\u52d5\u8a5e<\/p>\n<p>3\u3001\u8981\u60f3\u4f7f\u7528\u5176\u4ed6\u7684HTTP\u52d5\u8a5e\uff0c\u4f60\u9700\u8981\u5728IIS\u4e2d\u505a\u4e00\u4e9b\u914d\u7f6e\uff0c\u4f7f.svc\u6587\u4ef6\u53ef\u4ee5\u63a5\u53d7\u9019\u4e9b\u52d5\u8a5e\u7684\u8acb\u6c42<\/p>\n<p>4\u3001\u4f7f\u7528WebGet\u901a\u904e\u53c3\u6578\u50b3\u8f38\u6578\u64da\uff0c\u4e5f\u9700\u8981\u914d\u7f6e\u3002\u800c\u4e14\u5fc5\u9808\u6307\u5b9aUriTemplate<\/p>\n<p>5\u3001\u5b83\u652f\u6301XML\u3001JSON\u4ee5\u53caATOM\u9019\u4e9b\u6578\u64da\u683c\u5f0f<\/p>\n<h3>Web API<\/h3>\n<p>1\u3001\u9019\u662f\u4e00\u500b\u7c21\u55ae\u7684\u69cb\u5efaHTTP\u670d\u52d9\u7684\u65b0\u6846\u67b6<\/p>\n<p>2\u3001\u5728.net\u5e73\u53f0\u4e0aWeb API \u662f\u4e00\u500b\u958b\u6e90\u7684\u3001\u7406\u60f3\u7684\u3001\u69cb\u5efaREST-ful \u670d\u52d9\u7684\u6280\u8853<\/p>\n<p>3\u3001\u4e0d\u50cfWCF REST Service.\u5b83\u53ef\u4ee5\u4f7f\u7528HTTP\u7684\u5168\u90e8\u7279\u9ede\uff08\u6bd4\u5982URIs\u3001request\/response\u982d\uff0c\u7de9\u5b58\uff0c\u7248\u672c\u63a7\u5236\uff0c\u591a\u7a2e\u5167\u5bb9\u683c\u5f0f\uff09<\/p>\n<p>4\u3001\u5b83\u4e5f\u652f\u6301MVC\u7684\u7279\u5fb5\uff0c\u50cf\u8def\u7531\u3001\u63a7\u5236\u5668\u3001action\u3001filter\u3001\u6a21\u578b\u7d81\u5b9a\u3001\u63a7\u5236\u53cd\u8f49\uff08IOC\uff09\u6216\u4f9d\u8cf4\u6ce8\u5165\uff08DI\uff09\uff0c\u55ae\u5143\u6e2c\u8a66\u3002\u9019\u4e9b\u53ef\u4ee5\u4f7f\u7a0b\u5e8f\u66f4\u7c21\u55ae\u3001\u66f4\u5065\u58ef<\/p>\n<p>5\u3001\u5b83\u53ef\u4ee5\u90e8\u7f72\u5728\u61c9\u7528\u7a0b\u5f0f\u548cIIS\u4e0a<\/p>\n<p>6\u3001\u9019\u662f\u4e00\u500b\u8f15\u91cf\u7d1a\u7684\u6846\u67b6\uff0c\u4e26\u4e14\u5c0d\u9650\u5236\u5e36\u5bec\u7684\u8a2d\u5099\uff0c\u6bd4\u5982\u667a\u6167\u578b\u624b\u6a5f\u7b49\u652f\u6301\u7684\u5f88\u597d<\/p>\n<p>7\u3001Response\u53ef\u4ee5\u88abWeb API\u7684MediaTypeFormatter\u8f49\u63db\u6210Json\u3001XML \u6216\u8005\u4efb\u4f55\u4f60\u60f3\u8f49\u63db\u7684\u683c\u5f0f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u539f\u6587\u7db2\u5740\uff1ahttps:\/\/read01.com\/6GdOdP.html &nbsp; \u5728.net\u5e73\u53f0\u4e0b\uff0c\u6709\u5927\u91cf &hellip; <a href=\"https:\/\/jason695.why3s.tw\/wordpress\/2018\/05\/23\/wcf%e3%80%81webapi%e3%80%81wcfrest%e3%80%81webservice%e4%b9%8b%e9%96%93%e7%9a%84%e5%8d%80%e5%88%a5\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587 <span class=\"screen-reader-text\">WCF\u3001WebAPI\u3001WCFREST\u3001WebService\u4e4b\u9593\u7684\u5340\u5225<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-2652","post","type-post","status-publish","format-standard","hentry","category-net","no-featured-image"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/2652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/comments?post=2652"}],"version-history":[{"count":0,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/posts\/2652\/revisions"}],"wp:attachment":[{"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/media?parent=2652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/categories?post=2652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jason695.why3s.tw\/wordpress\/wp-json\/wp\/v2\/tags?post=2652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}