{"id":374,"date":"2021-08-03T13:21:36","date_gmt":"2021-08-03T04:21:36","guid":{"rendered":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=374"},"modified":"2021-08-03T13:21:36","modified_gmt":"2021-08-03T04:21:36","slug":"dotnet-core%e7%b3%bb%e3%81%8b%e3%82%89%e3%81%aesoap%e3%82%a2%e3%82%af%e3%82%bb%e3%82%b9","status":"publish","type":"post","link":"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=374","title":{"rendered":"dotnet core\u7cfb\u304b\u3089\u306eSOAP\u30a2\u30af\u30bb\u30b9"},"content":{"rendered":"\n<p>SOAP\u3092\u4f7f\u7528\u3057\u305fWeb API\u3063\u3066\u3001\u6700\u8fd1\u306f\u3042\u307e\u308a\u898b\u304b\u3051\u306a\u3044\u3051\u3069\u3001\u307e\u3041\u3001\u6b8b\u3063\u3066\u3044\u308b\u3068\u3053\u308d\u306b\u306f\u6b8b\u3063\u3066\u3044\u3066\u3001\u305d\u308c\u3092\u4f7f\u3044\u305f\u304b\u3063\u305f\u306e\u3067\u3001dotnet core\u7cfb\u304b\u3089\u4f7f\u3046\u306b\u306f\u3069\u3046\u3059\u308c\u3070\u826f\u3044\u304b\u3092\u8abf\u3079\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<p>.NET Framework\u306e\u9803\u306fVisual Studio\u3092\u4f7f\u3063\u3066\u3001\u30b5\u30fc\u30d3\u30b9\u53c2\u7167\u304b\u3089\u8ffd\u52a0\u3059\u308c\u3070\u7c21\u5358\u306b\u3067\u304d\u305f\u306e\u3060\u304c\u3001dotnet core\u7cfb\u3067CLI\u74b0\u5883\u3067\u306f\u305d\u3046\u3044\u3046\u308f\u3051\u306b\u306f\u3044\u304b\u306a\u3044\u3002\u3067\u3001\u8abf\u3079\u3066\u307f\u305f\u3089\u3001svcutil\u3092\u4f7f\u3063\u3066\u3001WSDL\u304b\u3089\u30a2\u30af\u30bb\u30b9\u7528\u306e\u30af\u30e9\u30b9\u3068\u30c7\u30fc\u30bf\u30af\u30e9\u30b9\u3092\u81ea\u52d5\u751f\u6210\u3057\u3066\u304f\u308c\u308b\u3088\u3046\u3060\u3002svcutil\u306f.NET Framework\u304b\u3089\u3042\u3063\u305f\u3051\u3069\u3001dotnet core\u7cfb\u306e\u5834\u5408\u3001tool\u3068\u3057\u3066\u3001dotnet-svcutil\u304c\u63d0\u4f9b\u3055\u308c\u3066\u3044\u308b\u3002\u307e\u305a\u3001\u3053\u306e\u30c4\u30fc\u30eb\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u3088\u3046\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-file=\"svcutil\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\" data-lang=\"Bash\"><code>dotnet tool install dotnet-svcutil -g<\/code><\/pre><\/div>\n\n\n\n<p>\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u3066\u3001WSDL\u304b\u3089\u30a2\u30af\u30bb\u30b9\u7528\u3068\u30c7\u30fc\u30bf\u7528\u306e\u30af\u30e9\u30b9\u3092\u751f\u6210\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-bash\" data-file=\"\u30af\u30e9\u30b9\u751f\u6210\" data-lang=\"Bash\"><code>dotnet svcutil &lt;WSDL\u306eURL&gt;<\/code><\/pre><\/div>\n\n\n\n<p>\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f55\u3082\u6307\u5b9a\u3057\u306a\u3044\u3068\u3001\u5b9f\u884c\u3057\u305f\u30d5\u30a9\u30eb\u30c0\u306e\u4e0b\u306bServiceReference\u3068\u8a00\u3046\u30d5\u30a9\u30eb\u30c0\u304c\u4f5c\u6210\u3055\u308c\u3001namespace ServiceReference\u4e2d\u306b\u30a2\u30af\u30bb\u30b9\u7528\u306e\u30af\u30e9\u30b9\u3068\u30c7\u30fc\u30bf\u30af\u30e9\u30b9\u304c\u4f5c\u6210\u3055\u308c\u308b\u3002\u30aa\u30d7\u30b7\u30e7\u30f3\u6307\u5b9a\u3067\u30d5\u30a9\u30eb\u30c0\u540d\u3084namespace\u306e\u6307\u5b9a\u3082\u53ef\u80fd\u3002<\/p>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u3001\u30b5\u30fc\u30d3\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u4e0b\u8a18\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u8ffd\u52a0\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>System.ServiceModel.Primitives<\/li><li>System.ServiceModel.Http<\/li><\/ul>\n\n\n\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u4e2d\u304b\u3089SOAP\u30b5\u30fc\u30d3\u30b9\u306b\u63a5\u7d9a\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b5\u30fc\u30d3\u30b9\u30a2\u30af\u30bb\u30b9\u7528\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u6210\u3057\u3066\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u3002(\u8a8d\u8a3c\u7b49\u3092\u4f7f\u7528\u3057\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u5834\u5408\u306fbinding\u3084\u8a8d\u8a3c\u8a2d\u5b9a\u306a\u3069\u304c\u5fc5\u8981)<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"\u30b5\u30fc\u30d3\u30b9\u30e1\u30bd\u30c3\u30c9\u306e\u547c\u51fa\" data-lang=\"C#\"><code>using System.ServiceModel;\nusing ServiceReference; \/\/ svcutil\u3067namespace\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u305d\u306enamespace\n\u30fb\u30fb\u30fb\n\/\/ \u30b5\u30fc\u30d3\u30b9\u30a2\u30af\u30bb\u30b9\u7528\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u4f5c\u6210\nvar cli = new &lt;\u30b5\u30fc\u30d3\u30b9\u540d&gt;Client();\n\/\/ \u30b5\u30fc\u30d3\u30b9\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\nvar result = await cli.&lt;\u30e1\u30bd\u30c3\u30c9\u540d&gt;Async(&lt;\u30d1\u30e9\u30e1\u30fc\u30bf&gt;);\n<\/code><\/pre><\/div>\n\n\n\n<p>\u4f8b<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism undefined-numbers lang-csharp\" data-file=\"\u4f8b\" data-lang=\"C#\"><code>using System.ServiceModel;\nusing ServiceReference; \/\/ svcutil\u3067namespace\u3092\u6307\u5b9a\u3057\u305f\u5834\u5408\u306f\u305d\u306enamespace\n\u30fb\u30fb\u30fb\n\/\/ GetUserService SOAP\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\n\/\/ \u203b\u8a8d\u8a3c\u306a\u3057\nvar cli = new GetUserServiceClient();\n\n\/\/ \u30e6\u30fc\u30b6\u30fc\u756a\u53f700001\u756a\u306e\u30e6\u30fc\u30b6\u30fc\u3092\u53d6\u5f97\n\/\/ \u203bUser\u30af\u30e9\u30b9\u5b9a\u7fa9\u306fWSDL\u304b\u3089\u81ea\u52d5\u7684\u306b\u751f\u6210\u3055\u308c\u308b\nUser ret = await cli.GetUserAsync(&quot;00001&quot;);<\/code><\/pre><\/div>\n\n\n\n<p>\u4ee5\u4e0a\u3001\u5fd8\u308c\u306a\u3044\u3088\u3046\u306b\u30e1\u30e2\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>SOAP\u3092\u4f7f\u7528\u3057\u305fWeb API\u3063\u3066\u3001\u6700\u8fd1\u306f\u3042\u307e\u308a\u898b\u304b\u3051\u306a\u3044\u3051\u3069\u3001\u307e\u3041\u3001\u6b8b\u3063\u3066\u3044 &hellip; <a href=\"https:\/\/sumomo.ohwaki.jp\/wordpress\/?p=374\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,9,4],"tags":[],"class_list":["post-374","post","type-post","status-publish","format-standard","hentry","category-net","category-c","category-4"],"_links":{"self":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/374","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=374"}],"version-history":[{"count":2,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions"}],"predecessor-version":[{"id":376,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/374\/revisions\/376"}],"wp:attachment":[{"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=374"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=374"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumomo.ohwaki.jp\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=374"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}