{"id":264213,"date":"2015-08-25T11:37:02","date_gmt":"2015-08-25T07:37:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=264213"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=264213","title":{"rendered":"\u0423\u0440\u043e\u043a\u0438 WCF. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430"},"content":{"rendered":"<br \/>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043a\u0443\u0440\u0441 \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Windows_Communication_Foundation\">WCF<\/a> \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  <a name=\"top\"><\/a>  <\/p>\n<h3>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<ol>\n<li><a href=\"#content\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u043a\u0430<\/a><\/li>\n<li><a href=\"#create\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/li>\n<li><a href=\"#hosting\">\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/li>\n<li><a href=\"#publish\">\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/li>\n<li> <a href=\"#execute\">\u0412\u044b\u0437\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><br \/> \n<ul>\n<li><a href=\"#exeTestClient\">\u041a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 C#<\/a><\/li>\n<li><a href=\"#exeSoapUI\">SoapUI<\/a><\/li>\n<li><a href=\"#exeWebInvoke\">WebInvoke<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li><a href=\"#links\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/a><\/li>\n<\/ol>\n<p>  <a name=\"habracut\"><\/a><br \/>  <a name=\"content\"><\/a><\/p>\n<h3>1. \u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u043a\u0430<\/h3>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0443\u0440\u043e\u043a\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 WCF-\u0441\u0435\u0440\u0432\u0438\u0441 \u00ab\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u00bb, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u0447\u0435\u0442\u044b\u0440\u0435 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 IIS \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0438\u0437 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 C# \u0438\u043b\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b <a href=\"http:\/\/www.soapui.org\/\">SoapUI<\/a>, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0431 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0438\u043b\u0438 Ajax).<\/p>\n<p>  \u0423\u0440\u043e\u043a \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d \u043d\u0430 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 C#, \u0440\u0435\u0448\u0438\u0432\u0448\u0438\u0445 \u043e\u0441\u0432\u043e\u0438\u0442\u044c \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u044e WCF. \u041e\u043f\u044b\u0442\u043d\u044b\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0438\u0437 \u0440\u0430\u0437\u0434\u0435\u043b\u0430 <a href=\"#exeWebInvoke\">WebInvoke<\/a>, \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a \u0434\u043b\u044f Ajax.<\/p>\n<p>  <a name=\"create\"><\/a><\/p>\n<h3>2. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h3>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u0412 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f Visual Studio 2013 Professional, \u0432\u0435\u0440\u0441\u0438\u044f \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u0430 4.5.1. \u0414\u043b\u044f \u0437\u0430\u043c\u0435\u0442\u043a\u0438: \u0437\u0430 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0441\u0438\u044f\u043c\u0438 4.0. \u0438 4.5.1 \u043d\u0435\u0442, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439, \u0442.\u043a. \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 WSDL \u043e\u0434\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0441\u0442\u0443\u0434\u0438\u044e \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 <b>WCF Service Application<\/b> \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435, \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e <b>SampleService<\/b>.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/dad\/496\/e58\/dad496e58f8b409086a17e660bfc6856.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 \u043e\u0431\u043e\u0437\u0440\u0435\u0432\u0430\u0442\u0435\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c9d\/795\/237\/c9d7952375054e9b826c7e6ac0850402.png\"\/><\/p>\n<p>  1. <i>IService1.cs<\/i> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0442.\u0435. \u043d\u0430\u0431\u043e\u0440 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442.<br \/>  2. <i>Service1.svc<\/i> \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0447\u0430\u0441\u0442\u0435\u0439 \u2014 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (Service1.svc.cs) \u0438 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 (Markup), \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0432 \u043c\u0435\u043d\u044e \u043f\u043e \u043a\u043b\u0438\u043a\u0443 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438.<br \/>  3. <i>Web.config<\/i> \u2014 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<br \/>  4. \u041f\u0430\u043f\u043a\u0430 <i>App_Data<\/i> \u043d\u0430\u043c \u043f\u043e\u043a\u0430 \u043d\u0435 \u043d\u0443\u0436\u043d\u0430 \u2014 \u0443\u0434\u0430\u043b\u044f\u0435\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0435\u0440\u0435\u0438\u043c\u0435\u043d\u0443\u0435\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0438 \u0435\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441, \u043f\u0440\u0438\u0434\u0430\u0432 \u0438\u043c \u0438\u043c\u0435\u043d\u0430 Calculator \u0438 ICalculator \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0441\u0442\u0440\u043e\u0447\u043a\u0443 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (\u0444\u0430\u0439\u043b Calculator.svc):  <\/p>\n<pre><code class=\"xml\">&lt;%@ ServiceHost Language=&quot;C#&quot; Debug=&quot;true&quot; Service=&quot;SampleService.Calculator&quot; CodeBehind=&quot;Calculator.svc.cs&quot; %&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043e\u043f\u0438\u0448\u0435\u043c \u0441\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430. \u041e\u0431\u044a\u044f\u0432\u0438\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (Addition), \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 (Subtraction), \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 (Multiplication) \u0438 \u0434\u0435\u043b\u0435\u043d\u0438\u0435 (Division). \u0422\u0430\u043a\u0436\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 TestConnection, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0440\u043e\u043a\u0443. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u044b \u0441\u043c\u043e\u0433\u0443\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0435\u0440\u0432\u0438\u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0438\u0440\u0443\u0435\u0442, \u0442.\u043a. \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u00ab\u043f\u0438\u043d\u0433\u0430\u00bb WCF \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442. \u0412\u0441\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c [OperationContract], \u0438\u043d\u0430\u0447\u0435 \u043e\u043d\u0438 \u043d\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432\u0438\u0434\u043d\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0430\u043c.<\/p>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435, \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438\u043c\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ICalculator.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text;  namespace SampleService {     [ServiceContract]     public interface ICalculator     {         #region Common Methods          \/\/\/ &lt;summary&gt;         \/\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;returns&gt; OK &lt;\/returns&gt;         [OperationContract]         string TestConnection();          #endregion          #region Arithmetic          \/\/\/ &lt;summary&gt;         \/\/\/ \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 1 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 2 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0441\u0443\u043c\u043c\u0430 &lt;\/returns&gt;         [OperationContract]         double Addition(double a, double b);          \/\/\/ &lt;summary&gt;         \/\/\/ \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c &lt;\/returns&gt;         [OperationContract]         double Subtraction(double a, double b);          \/\/\/ &lt;summary&gt;         \/\/\/ \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 1 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 2 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 &lt;\/returns&gt;         [OperationContract]         double Multiplication(double a, double b);          \/\/\/ &lt;summary&gt;         \/\/\/ \u0434\u0435\u043b\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0434\u0435\u043b\u0438\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0447\u0430\u0441\u0442\u043d\u043e\u0435 &lt;\/returns&gt;         [OperationContract]         double Division(double a, double b);          #endregion     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0432 \u043a\u043b\u0430\u0441\u0441\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Calculator.svc.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text;  namespace SampleService {     public class Calculator : ICalculator     {         #region Common Methods          \/\/\/ &lt;summary&gt;         \/\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;returns&gt; OK &lt;\/returns&gt;         public string TestConnection()         {             return &quot;OK&quot;;         }          #endregion          #region Arithmetic          \/\/\/ &lt;summary&gt;         \/\/\/ \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 1 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 2 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0441\u0443\u043c\u043c\u0430 &lt;\/returns&gt;         public double Addition(double a, double b)         {             return a + b;         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c &lt;\/returns&gt;         public double Subtraction(double a, double b)         {             return a - b;         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 1 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 2 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 &lt;\/returns&gt;         public double Multiplication(double a, double b)         {             return a * b;         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0434\u0435\u043b\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0434\u0435\u043b\u0438\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0447\u0430\u0441\u0442\u043d\u043e\u0435 &lt;\/returns&gt;         public double Division(double a, double b)         {             return a \/ b;         }          #endregion     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041b\u043e\u0433\u0438\u043a\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0430, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0435.<\/p>\n<p>  <a name=\"hosting\"><\/a><\/p>\n<h3>3. \u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h3>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u0421\u0430\u043c \u043f\u043e \u0441\u0435\u0431\u0435 \u0441\u0435\u0440\u0432\u0438\u0441 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0430\u0439\u043b SampleService.dll), \u0438 \u0434\u043b\u044f \u0435\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0432\u0438\u0434\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 WCF \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<ul>\n<li>1. \u0425\u043e\u0441\u0442\u0438\u043d\u0433 \u043d\u0430 IIS.<\/li>\n<li>2. \u0417\u0430\u043f\u0443\u0441\u043a \u0432 \u0432\u0438\u0434\u0435 \u0441\u043b\u0443\u0436\u0431\u044b Windows.<\/li>\n<li>3. Self hosting (\u0441\u0435\u0440\u0432\u0438\u0441 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d \u0432 \u0432\u0438\u0434\u0435 \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441).<\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438\u043d\u0446\u0438\u043f\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u0438\u044f \u0432 \u044d\u0442\u0438\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u043d\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043d\u0430 IIS. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0435\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00abWeb\u00bb. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0430\u0442\u044c \u0443 \u0441\u0435\u0431\u044f, \u0430 \u0432\u043e\u0442 \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ce1\/008\/59f\/ce100859f0924cac81ac8394253a2f05.png\"\/><\/p>\n<p>  \u0420\u0430\u0437\u0434\u0435\u043b <b>Start Action<\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 \u0441\u0442\u0443\u0434\u0438\u0438:<\/p>\n<ul>\n<li>Current Page (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u2013 \u0437\u0430\u043f\u0443\u0441\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435. \u0423 \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u043a\u0430 \u043d\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 url-\u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u043e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442.<\/li>\n<li>Specific Page \u2013 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b.<\/li>\n<li>Start External program \u2013 \u0437\u0430\u043f\u0443\u0441\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u043d\u0438\u0446\u0438\u0438\u0440\u0443\u0435\u0442 \u0441\u0435\u0440\u0432\u0438\u0441, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b\u0437\u043e\u0432\u0435\u0442 \u043c\u0435\u0442\u043e\u0434, \u043d\u0443\u0436\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0432 \u043e\u0442\u043b\u0430\u0434\u043a\u0435.<\/li>\n<li>Start URL \u2013 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u043f\u043e\u043b\u0435 URL \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435.<\/li>\n<li>Don&#8217;t open a page \u2013 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c, \u043d\u043e \u0436\u0434\u0430\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/li>\n<\/ul>\n<p>  \u0412\u043e \u0432\u0441\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0441\u0435\u0440\u0432\u0438\u0441 \u00ab\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f\u00bb \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0442\u043b\u0430\u0434\u043a\u0438 \u0438 \u0432\u0435\u0434\u0435\u0442 \u0441\u0435\u0431\u044f \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0443\u0434\u0438\u0438, \u0442.\u0435. \u0440\u0435\u0430\u0433\u0438\u0440\u0443\u0435\u0442 \u043d\u0430 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0443\u0434\u043e\u0431\u0435\u043d \u0442\u0435\u043c, \u0447\u0442\u043e \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435, \u0442.\u043a. \u043e\u0442\u043b\u0430\u0434\u043a\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u2014 \u043d\u0435 \u043b\u0443\u0447\u0448\u0438\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u0434\u043b\u044f WCF \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0438\u0436\u0435.<\/p>\n<p>  \u0420\u0430\u0437\u0434\u0435\u043b <b>Servers<\/b> \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u0433\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u0441\u0435\u0440\u0432\u0438\u0441. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0431\u0440\u0430\u043d IIS Express (\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0439 \u0432 \u0441\u0442\u0443\u0434\u0438\u044e \u0432\u0430\u0440\u0438\u0430\u043d\u0442 IIS), \u043d\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u043c\u0438 \u0438 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u043c IIS. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c IIS \u0432 \u043f\u0430\u043d\u0435\u043b\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b (ASP .NET, Basic-\u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435).<\/p>\n<p>  \u041f\u043e\u0434 \u0441\u043f\u043e\u0439\u043b\u0435\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043d\u0430\u0431\u043e\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b IIS<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/516\/bc4\/113\/516bc41138f44060a09d4cf322d622b2.png\"\/>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0430\u0434\u0440\u0435\u0441\u0430 \u0432 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0436\u0430\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u00abCreate Virtual Directory\u00bb. \u0417\u0430\u0442\u0435\u043c \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0435\u043a\u0442 \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c <a href=\"https:\/\/msdn.microsoft.com\/ru-ru\/library\/Bb763170(v=VS.100).aspx\">\u0434\u0438\u0441\u043f\u0435\u0442\u0447\u0435\u0440 \u0441\u043b\u0443\u0436\u0431 IIS<\/a>. \u041d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0443\u0436\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441\u0430\u0439\u0442\u0430 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e (Default Web Site), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0435\u043c\u0443 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043f\u0443\u043b (DefaultAppPool). \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0443\u043b \u0434\u043b\u044f \u0432\u0430\u0448\u0438\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432, \u0443\u043a\u0430\u0437\u0430\u0432 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b .NET 4.0:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8c9\/32a\/8a1\/8c932a8a18834431a4fcbef70494a43b.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043f\u0443\u043b\u0430, \u043d\u0430\u0437\u043d\u0430\u0447\u044c\u0442\u0435 \u0435\u0433\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e (Default Web Site &gt; Lesson1 &gt; \u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b &gt; \u041f\u0443\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0442\u0440\u0438\u0445 \u2014 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0441\u0442\u0440\u043e\u043a\u0443, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u043c\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e Calculator.svc: <a href=\"http:\/\/localhost\/Lesson1\/Calculator.svc\">http:\/\/localhost\/Lesson1\/Calculator.svc<\/a>. \u0418\u0442\u043e\u0433 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/3c8\/dd4\/60c\/3c8dd460c67f4c8684709114642265e6.png\"\/><\/p>\n<p>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/b> \u0415\u0441\u043b\u0438 \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u0432\u044b \u0432\u044b\u0431\u0440\u0430\u043b\u0438 .NET 4.0 \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0430 \u043c\u0430\u0448\u0438\u043d\u0435, \u0433\u0434\u0435 \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d .NET 4.0, \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 WSDL \u043e\u0434\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c (<a href=\"http:\/\/localhost\/Lesson1\/Calculator.svc?singleWsdl\">http:\/\/localhost\/Lesson1\/Calculator.svc?singleWsdl<\/a>) \u043d\u0435 \u0431\u0443\u0434\u0435\u0442. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u0432\u0435\u0440\u0441\u0438\u0438 \u043d\u0435 \u043d\u0438\u0436\u0435 4.5, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0441\u0430\u043c \u0441\u0435\u0440\u0432\u0438\u0441 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d \u043d\u0430 .NET 4.0. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0437\u0430\u0431\u0430\u0432\u043d\u0430\u044f \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u043d\u043e \u0437\u0430 \u044d\u0442\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0430 \u043d\u0435 \u0442\u043e\u0442, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043b\u0441\u044f \u0441\u0435\u0440\u0432\u0438\u0441. \u042d\u0442\u043e, \u043f\u043e\u0436\u0430\u043b\u0443\u0439, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 .NET 4.0 \u043e\u0442 .NET 4.5 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043e <a href=\"https:\/\/ru.wikipedia.org\/wiki\/WSDL\">WSDL<\/a>. \u041f\u043e \u0441\u0443\u0442\u0438 \u044d\u0442\u043e XML, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0430\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0435\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438 \u0442\u043e\u0447\u0435\u043a \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f. \u0427\u0442\u043e\u0431\u044b \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0438\u0435 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443, \u0438\u043c \u043d\u0443\u0436\u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 WSDL. WSDL \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u0430 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e) \u0438\u043b\u0438 \u0431\u044b\u0442\u044c \u043e\u0434\u043d\u0438\u043c \u0444\u0430\u0439\u043b\u043e\u043c (\u0441\u043c. \u0432\u044b\u0448\u0435). \u0412\u0430\u0436\u043d\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435 \u0432\u0441\u0435 \u043a\u043b\u0438\u0435\u043d\u0442\u044b (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, SoapClient \u043d\u0430 PHP) \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 WSDL, \u0440\u0430\u0437\u0431\u0438\u0442\u043e\u0439 \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u043e\u0434\u043d\u043e\u0444\u0430\u0439\u043b\u043e\u0432\u043e\u0439 WSDL \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442\u0441\u044f.<\/p>\n<p>  <a name=\"publish\"><\/a><\/p>\n<h3>4. \u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h3>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u041f\u043e\u0434 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442\u0441\u044f \u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0432\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u0432\u044b\u043b\u043e\u0436\u0438\u0432 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043a\u043b\u0438\u043a\u043d\u0435\u043c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043f\u0443\u043d\u043a\u0442 Publish&#8230;:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c64\/02e\/862\/c6402e86274d46b88cd2885ed6935b65.png\"\/><\/p>\n<p>  \u041c\u0430\u0441\u0442\u0435\u0440 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u0442 \u043d\u0430\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u0432\u044b\u0431\u0435\u0440\u0435\u043c Custom, \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043d\u0430\u0437\u043e\u0432\u0435\u043c Demo.<br \/>  \u0417\u0430\u0442\u0435\u043c \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043c\u0435\u0442\u043e\u0434 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 File System \u0438 \u0443\u043a\u0430\u0436\u0435\u043c \u043f\u0443\u0442\u044c, \u043a\u0443\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u043d\u0430\u0448\u0430 \u0441\u0431\u043e\u0440\u043a\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/857\/408\/a52\/857408a52ef44e8e9db4786d540de9cb.png\"\/><\/p>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u0433\u043e\u0442\u043e\u0432 \u043a \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438, \u043d\u043e \u0436\u0435\u043b\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0435\u0449\u0435 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 (Settings) \u0438 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u0433\u0430\u043b\u043e\u0447\u043a\u0443 \u00abDelete all existing files prior to publish\u00bb (\u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u0435\u0440\u0435\u0434 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0435\u0439) \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e.<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/5fd\/8c5\/859\/5fd8c58595564482b4569a64df5628b1.png\"\/><\/p>\n<p>  \u0412\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044e \u0438 \u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u0447\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0432 \u0438\u0442\u043e\u0433\u0435:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/084\/e30\/73e\/084e3073e49149c58400480ae6562d21.png\"\/><\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430 \u0432\u0430\u0448\u0435\u043c \u0441\u0430\u0439\u0442\u0435, \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0439\u0442\u0435 \u043f\u0430\u043f\u043a\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u043a IIS \u043a\u0430\u043a \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u044d\u0442\u043e \u0431\u044b\u043b \u043e\u0431\u044b\u0447\u043d\u044b\u0439 \u0441\u0430\u0439\u0442 (Default Web Site &gt; Add Application&#8230;)<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/495\/e92\/ab6\/495e92ab697e41229fcbbe433c15a103.png\"\/><\/p>\n<p>  \u0413\u043e\u0442\u043e\u0432\u043e! \u0421\u0435\u0440\u0432\u0438\u0441 \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d \u043f\u043e \u0430\u0434\u0440\u0435\u0441\u0443 <a href=\"http:\/\/dszss.proitr.ru\/WCFLesson1\/Calculator.svc\">http:\/\/dszss.proitr.ru\/WCFLesson1\/Calculator.svc<\/a>.<\/p>\n<p>  <a name=\"execute\"><\/a><\/p>\n<h3>5. \u0412\u044b\u0437\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/h3>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0440\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430: \u0432\u044b\u0437\u043e\u0432 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 C#, \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 SoapUI \u0438 \u0437\u0430\u043f\u0440\u043e\u0441 \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c URL (WebInvoke).<\/p>\n<p>  <a name=\"exeTestClient\"><\/a><\/p>\n<h4>\u041a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 C#<\/h4>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 C#. \u0422\u0430\u043a \u043a\u0430\u043a WCF \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0432 Visual Studio, \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430. \u0412\u0441\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0437\u043d\u0430\u0442\u044c \u2014 \u044d\u0442\u043e \u0430\u0434\u0440\u0435\u0441 WSDL \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u0441\u044f.<\/p>\n<p>  \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 \u043d\u0430\u0448\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 Console Application \u0438 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0435\u0433\u043e TestClient. \u041d\u0430\u0437\u043d\u0430\u0447\u0438\u043c \u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u043c \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c7d\/062\/b33\/c7d062b3360941d690a7edec1e110237.png\"\/><\/p>\n<p>  \u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0432\u0432\u0435\u0434\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043f\u043e \u0436\u0435\u043b\u0430\u043d\u0438\u044e \u0443\u043a\u0430\u0436\u0435\u043c \u0438\u043c\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430\u0448 \u0441\u0435\u0440\u0432\u0438\u0441:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/72e\/13a\/c7b\/72e13ac7b03d43be971b46f3bb9879fe.png\"\/><\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0441\u0435\u0440\u0432\u0438\u0441, \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u0430\u043f\u043a\u0430 \u00abService References\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0441\u0443\u0442\u0438\u0434\u0435\u0439 \u043a\u043b\u0438\u0435\u043d\u0442. \u0415\u0433\u043e \u043a\u043e\u0434 \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u0430\u0434\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u043a\u0440\u044b\u0442\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u0439\u0442\u0438 \u043f\u043e F12 \u0432\u043d\u0443\u0442\u0440\u044c \u043a\u043e\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043a\u043e\u0434 \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u0438 \u0432\u044b\u0437\u043e\u0432 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u044b\u0445 \u0438\u043c:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442<\/b><\/p>\n<div class=\"spoiler_text\">\n<div class=\"spoiler\"><b class=\"spoiler_title\">Program.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks;  \/\/ \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0441\u0435\u0440\u0432\u0438\u0441\u0430 using TestClient.RemoteService;  namespace TestClient {     class Program     {         static void Main(string[] args)         {             \/\/ \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a \u0432\u044b\u0432\u043e\u0434\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c             ConsoleWriter writer = new ConsoleWriter();              \/\/ \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0438\u0435\u043d\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430             CalculatorClient client = new CalculatorClient(&quot;BasicHttpBinding_ICalculator&quot;);              try             {                 \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f                 writer.Write(&quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u043c... &quot;);                 if (!string.Equals(client.TestConnection(), &quot;OK&quot;, StringComparison.InvariantCultureIgnoreCase))                 {                     throw new Exception(&quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u043d\u0435 \u0443\u0434\u0430\u043b\u0430\u0441\u044c&quot;);                 }                 writer.WriteLineSuccess();                 writer.WriteLine();                  \/\/ \u043b\u044f\u043c\u0431\u0434\u0430-\u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u0430                 var CheckArithmeticOperation = new Action&lt;Func&lt;double, double, double&gt;, string, double, double, double&gt;                 (                     (operation, operationName, arg1, arg2, expectedResult) =&gt;                     {                         writer.Write(&quot;\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 '&quot;);                         writer.Write(ConsoleColor.White, operation.Method.Name);                         writer.Write(&quot;', {0} {1} {2} = &quot;, arg1.ToString(CultureInfo.InvariantCulture), operationName, arg2.ToString(CultureInfo.InvariantCulture));                         double result = operation(arg1, arg2);                         if (result == expectedResult)                         {                             \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043f\u0440\u043e\u0439\u0434\u0435\u043d\u0430                             writer.Write(&quot;{0} &quot;, result.ToString(CultureInfo.InvariantCulture));                             writer.WriteLineSuccess();                         }                         else                         {                             \/\/ \u043e\u0448\u0438\u0431\u043a\u0430                             throw new Exception(string.Format(&quot;\u041e\u0448\u0438\u0431\u043a\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 '{0}': {1} {2} {3} != {4}&quot;,                                 operation.Method.Name, arg1.ToString(CultureInfo.InvariantCulture), operationName, arg2.ToString(CultureInfo.InvariantCulture), expectedResult.ToString(CultureInfo.InvariantCulture)));                         }                     }                 );                  \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 Addition                 CheckArithmeticOperation(client.Addition, &quot;+&quot;, 2.5, 5, 2.5 + 5);                  \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 Subtraction                 CheckArithmeticOperation(client.Subtraction, &quot;-&quot;, 2.5, 5, 2.5 - 5);                  \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 Multiplication                 CheckArithmeticOperation(client.Multiplication, &quot;*&quot;, 2.5, 5, 2.5 * 5);                  \/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 Division                 CheckArithmeticOperation(client.Division, &quot;\/&quot;, 2.5, 5, 2.5 \/ 5);                  \/\/ \u0432 \u043a\u043e\u043d\u0446\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0437\u0430\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0438\u0435\u043d\u0442                 client.Close();             }             catch (Exception ex)             {                 \/\/ \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u0440\u044b\u0442\u044c \u043a\u043b\u0438\u0435\u043d\u0442 \u043c\u0435\u0442\u043e\u0434\u043e\u043c Abort()                 client.Abort();                  \/\/ \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435                 writer.WriteLine();                 writer.WriteLineError(&quot;\u041e\u0448\u0438\u0431\u043a\u0430: {0}&quot;, ex.Message);             }              Console.WriteLine();             Console.WriteLine(&quot;\u041d\u0430\u0436\u043c\u0438\u0442\u0435 \u043b\u044e\u0431\u0443\u044e \u043a\u043b\u0430\u0432\u0438\u0448\u0443 \u0434\u043b\u044f \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u044f...&quot;);             Console.ReadKey();         }     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ConsoleWriter.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System;  namespace TestClient {     \/\/\/ &lt;summary&gt;     \/\/\/ \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u044b\u0439 \u043f\u0438\u0441\u0430\u0442\u0435\u043b\u044c     \/\/\/ &lt;\/summary&gt;     public class ConsoleWriter     {         #region Declarations          private ConsoleColor _successColor;     \/\/ \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439         private ConsoleColor _errorColor;       \/\/ \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445         private ConsoleColor _warningColor;     \/\/ \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439-\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439          private string _successText;            \/\/ \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439         private string _errorText;              \/\/ \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445         private string _warningText;            \/\/ \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439-\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439          #endregion         #region Properties          \/\/\/ &lt;summary&gt;         \/\/\/ \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439         \/\/\/ &lt;\/summary&gt;         public ConsoleColor SuccessColor { get { return _successColor; } set { _successColor = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445         \/\/\/ &lt;\/summary&gt;         public ConsoleColor ErrorColor { get { return _errorColor; } set { _errorColor = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439-\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439         \/\/\/ &lt;\/summary&gt;         public ConsoleColor WarningColor { get { return _warningColor; } set { _warningColor = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0443\u0441\u043f\u0435\u0448\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439         \/\/\/ &lt;\/summary&gt;         public string SuccessText { get { return _successText; } set { _successText = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445         \/\/\/ &lt;\/summary&gt;         public string ErrorText { get { return _errorText; } set { _errorText = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0442\u0435\u043a\u0441\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439-\u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0439         \/\/\/ &lt;\/summary&gt;         public string WarningText { get { return _warningText; } set { _warningText = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0446\u0432\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u0430         \/\/\/ &lt;\/summary&gt;         public ConsoleColor ForegroundColor { get { return Console.ForegroundColor; } set { Console.ForegroundColor = value; } }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0446\u0432\u0435\u0442 \u0444\u043e\u043d\u0430         \/\/\/ &lt;\/summary&gt;         public ConsoleColor BackgroundColor { get { return Console.BackgroundColor; } set { Console.BackgroundColor = value; } }          #endregion          #region Constructors          \/\/\/ &lt;summary&gt;         \/\/\/ \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440         \/\/\/ &lt;\/summary&gt;         public ConsoleWriter()         {             _successColor = ConsoleColor.Green;             _errorColor = ConsoleColor.Red;             _warningColor = ConsoleColor.Blue;              _successText = &quot;OK&quot;;             _errorText = &quot;ERROR&quot;;             _warningText = &quot;WARNING&quot;;         }          #endregion          #region Private methods         #endregion         #region Protected methods         #endregion         #region Public methods          #region Write | WriteLine          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void Write(string value)         {             Console.Write(value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;color&quot;&gt; \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void Write(ConsoleColor color, string value)         {             ConsoleColor oldColor = Console.ForegroundColor;             Console.ForegroundColor = color;             Console.Write(value);             Console.ForegroundColor = oldColor;         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void Write(string format, params object[] args)         {             Console.Write(string.Format(format, args));         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;color&quot;&gt; \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void Write(ConsoleColor color, string format, params object[] args)         {             ConsoleColor oldColor = Console.ForegroundColor;             Console.ForegroundColor = color;             Console.Write(string.Format(format, args));             Console.ForegroundColor = oldColor;         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0432\u043e\u0434 \u0441\u0442\u0440\u043e\u043a\u0438 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteLine()         {             Console.WriteLine();         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteLine(string value)         {             Console.WriteLine(value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;color&quot;&gt; \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteLine(ConsoleColor color, string value)         {             ConsoleColor oldColor = Console.ForegroundColor;             Console.ForegroundColor = color;             Console.WriteLine(value);             Console.ForegroundColor = oldColor;         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteLine(string format, params object[] args)         {             Console.WriteLine(string.Format(format, args));         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;color&quot;&gt; \u0446\u0432\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteLine(ConsoleColor color, string format, params object[] args)         {             ConsoleColor oldColor = Console.ForegroundColor;             Console.ForegroundColor = color;             Console.WriteLine(string.Format(format, args));             Console.ForegroundColor = oldColor;         }          #endregion         #region WriteSuccess | WriteLineSuccess          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteSuccess()         {             Write(_successColor, _successText);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteSuccess(string value)         {             Write(_successColor, value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteSuccess(string format, params object[] args)         {             Write(_successColor, string.Format(format, args));         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteLineSuccess()         {             WriteLine(_successColor, _successText);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteLineSuccess(string value)         {             WriteLine(_successColor, value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteLineSuccess(string format, params object[] args)         {             WriteLine(_successColor, string.Format(format, args));         }          #endregion         #region WriteError | WriteLineError          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteError()         {             Write(_errorColor, _errorText);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteError(string value)         {             Write(_errorColor, value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteError(string format, params object[] args)         {             Write(_errorColor, string.Format(format, args));         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteLineError()         {             WriteLine(_errorColor, _errorText);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteLineError(string value)         {             WriteLine(_errorColor, value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteLineError(string format, params object[] args)         {             WriteLine(_errorColor, string.Format(format, args));         }          #endregion         #region WriteWarning | WriteLineWarning          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteWarning()         {             Write(_warningColor, _warningText);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteWarning(string value)         {             Write(_warningColor, value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteWarning(string format, params object[] args)         {             Write(_warningColor, string.Format(format, args));         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         public void WriteLineWarning()         {             WriteLine(_warningColor, _warningText);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;value&quot;&gt; \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 &lt;\/param&gt;         public void WriteLineWarning(string value)         {             WriteLine(_warningColor, value);         }          \/\/\/ &lt;summary&gt;         \/\/\/ \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;format&quot;&gt; \u0441\u0442\u0440\u043e\u043a\u0430 \u0444\u043e\u0440\u043c\u0430\u0442\u0430 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;args&quot;&gt; \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b &lt;\/param&gt;         public void WriteLineWarning(string format, params object[] args)         {             WriteLine(_warningColor, string.Format(format, args));         }          #endregion          #endregion     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/da9\/a79\/013\/da9a79013ee046f497061c9bae4724e2.png\"\/><\/p>\n<p>  \u0412 \u0446\u0435\u043b\u043e\u043c, \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0438\u0447\u0435\u043c \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 C#, \u0430 \u0442.\u043a. \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u043f\u0440\u0438 \u0438\u0445 \u0432\u044b\u0437\u043e\u0432\u0435. \u0422\u0430\u043a\u0436\u0435 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0432 \u0440\u0435\u0436\u0438\u043c\u0435 \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043e\u0442 \u0441\u0442\u043e\u0440\u043e\u043d\u043d\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (<a href=\"#hosting\">\u0441\u043c. \u0432\u044b\u0448\u0435<\/a>).<\/p>\n<p>  \u0422\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438, \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 \u043a\u043b\u0438\u0435\u043d\u0442 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442 Soap \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 (\u043e\u0431\u044b\u0447\u043d\u0430\u044f XML), \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043f\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u043e HTTP-\u043a\u0430\u043d\u0430\u043b\u0443 \u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043e \u0441\u043d\u0438\u0444\u0444\u0435\u0440\u043e\u043c. \u0420\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f, \u0432 \u0430\u0440\u0441\u0435\u043d\u0430\u043b\u0435 WCF \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0448\u0438\u0444\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\/\u0438\u043b\u0438 \u043f\u043e\u0434\u043f\u0438\u0441\u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u043d\u043e \u044d\u0442\u043e \u0443\u0436\u0435 \u0442\u0435\u043c\u0430 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0443\u0440\u043e\u043a\u0430.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0441\u043f\u043e\u0441\u043e\u0431\u0443 \u0432\u044b\u0437\u043e\u0432\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430.<\/p>\n<p>  <a name=\"exeSoapUI\"><\/a><\/p>\n<h4>SoapUI<\/h4>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  <a href=\"http:\/\/www.soapui.org\/\">SoapUI<\/a> \u2013 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f Soap-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0425\u043e\u0440\u043e\u0448\u0430 \u0442\u0435\u043c, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u0433\u043b\u044f\u043d\u0443\u0442\u044c \u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0435 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u0432 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u043a\u043e\u0433\u0434\u0430 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 \u0441\u0435\u0440\u0432\u0438\u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, SoapUI \u2014 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442, \u0437\u043d\u0430\u043a\u043e\u043c\u0441\u0442\u0432\u043e \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0435\u0441\u043b\u0438 \u0432\u044b \u0440\u0435\u0448\u0438\u043b\u0438 \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u043e \u0437\u0430\u043d\u044f\u0442\u044c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  \u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443 \u0438 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412 \u043f\u043e\u043b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430 WSDL \u0438 \u0432\u0432\u043e\u0434\u0438\u043c \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/746\/ca1\/095\/746ca1095cc344ee8974c37c7842f4c6.png\"\/><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, SoapUI \u0438\u0437\u0432\u043b\u0435\u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0438 \u0441\u043e\u0437\u0434\u0430\u043b \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/922\/9f3\/625\/9229f362574743f883a409e6f11b87f7.png\"\/><\/p>\n<p>  \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/845\/951\/7d3\/8459517d3cba4f64a90cba7c4d09047f.png\"\/><\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u0432\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u043b\u0438 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d xmlns=\u00ab<a href=\"http:\/\/tempuri.org\/\">tempuri.org<\/a>\u00bb. \u042d\u0442\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043d\u0430\u043c\u0438 \u043d\u0435 \u0431\u044b\u043b\u0438 \u0437\u0430\u0434\u0430\u043d\u044b \u0432 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435. \u0422.\u043a. \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c <a href=\"http:\/\/tempuri.org\">tempuri.org<\/a> \u043a\u0440\u0430\u0439\u043d\u0435 \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f, \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u043f\u0438\u0448\u0435\u043c \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u043d\u0430\u043c\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0438\u043c\u0435\u043d \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 <b>ServiceContract<\/b>:<\/p>\n<pre><code class=\"cs\">[ServiceContract(Namespace = &quot;http:\/\/dszss.proitr.ru\/WCF&quot;)] public interface ICalculator {     ... } <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430, \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0439 \u043a\u043b\u0438\u0435\u043d\u0442 \u0438 SoapUI \u0441\u0442\u0430\u043d\u0443\u0442 \u0432\u044b\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u00ab\u0421\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0441 Action \u201e<a href=\"http:\/\/tempuri.org\/ICalculator\/Addition\">tempuri.org\/ICalculator\/Addition<\/a>\u201c \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043e \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u0435\u043b\u044f \u0438\u0437-\u0437\u0430 \u043d\u0435\u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f ContractFilter \u043d\u0430 EndpointDispatcher\u00bb. \u0412 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u043c \u043a\u043b\u0438\u0435\u043d\u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 (RemoteService &gt; Update Service Reference), \u0430 \u0432 SoapUI \u2013 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 (Update Definition), \u043d\u0430\u0436\u0430\u0432 F5 \u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u0442\u043e\u0447\u043a\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f BasicHttpBinding_ICalculator \u0438 \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441.<\/p>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441-\u043e\u0442\u0432\u0435\u0442 \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/75b\/39e\/cd4\/75b39ecd449546379319d7fa5898df3d.png\"\/><\/p>\n<p>  \u0421 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u043c\u0438 SoapUI \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u043c \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e.<\/p>\n<p>  <a name=\"exeWebInvoke\"><\/a><\/p>\n<h4>WebInvoke<\/h4>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  WebInvoke \u2013 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u043e\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 WCF-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432 \u00ab\u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435\u00bb, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Ajax.<\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430, \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044e:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Web.config<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"xml\">&lt;?xml version=&quot;1.0&quot;?&gt; &lt;configuration&gt;    &lt;appSettings&gt;     &lt;add key=&quot;aspnet:UseTaskFriendlySynchronizationContext&quot; value=&quot;true&quot; \/&gt;   &lt;\/appSettings&gt;      &lt;system.web&gt;     &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.5.1&quot; \/&gt;     &lt;httpRuntime targetFramework=&quot;4.5.1&quot;\/&gt;   &lt;\/system.web&gt;      &lt;system.serviceModel&gt;     &lt;behaviors&gt;       &lt;endpointBehaviors&gt;         &lt;behavior name=&quot;Basic&quot; \/&gt;         &lt;behavior name=&quot;WebJson&quot;&gt;           &lt;webHttp defaultOutgoingResponseFormat=&quot;Json&quot; faultExceptionEnabled=&quot;true&quot; \/&gt;         &lt;\/behavior&gt;         &lt;behavior name=&quot;WebXML&quot;&gt;           &lt;webHttp defaultOutgoingResponseFormat=&quot;Xml&quot; faultExceptionEnabled=&quot;true&quot; \/&gt;         &lt;\/behavior&gt;       &lt;\/endpointBehaviors&gt;       &lt;serviceBehaviors&gt;         &lt;behavior&gt;           &lt;serviceMetadata httpGetEnabled=&quot;true&quot; httpsGetEnabled=&quot;true&quot; \/&gt;           &lt;serviceDebug includeExceptionDetailInFaults=&quot;false&quot; \/&gt;         &lt;\/behavior&gt;       &lt;\/serviceBehaviors&gt;     &lt;\/behaviors&gt;      &lt;bindings&gt;       &lt;basicHttpBinding&gt;         &lt;binding name=&quot;Basic&quot; closeTimeout=&quot;00:01:00&quot; openTimeout=&quot;00:01:00&quot;                  receiveTimeout=&quot;00:20:00&quot; sendTimeout=&quot;00:20:00&quot; maxBufferPoolSize=&quot;524288000&quot;                  maxBufferSize=&quot;65536000&quot; maxReceivedMessageSize=&quot;65536000&quot;&gt;           &lt;readerQuotas maxDepth=&quot;65536000&quot; maxStringContentLength=&quot;65536000&quot;                         maxArrayLength=&quot;65536000&quot; maxBytesPerRead=&quot;65536000&quot; maxNameTableCharCount=&quot;65536000&quot; \/&gt;         &lt;\/binding&gt;       &lt;\/basicHttpBinding&gt;       &lt;webHttpBinding&gt;         &lt;binding name=&quot;WebJson&quot; closeTimeout=&quot;00:01:00&quot; openTimeout=&quot;00:01:00&quot;                  receiveTimeout=&quot;00:20:00&quot; sendTimeout=&quot;00:20:00&quot; maxBufferSize=&quot;65536000&quot;                  maxBufferPoolSize=&quot;524288000&quot; maxReceivedMessageSize=&quot;65536000&quot;&gt;           &lt;readerQuotas maxDepth=&quot;65536000&quot; maxStringContentLength=&quot;65536000&quot;                         maxArrayLength=&quot;65536000&quot; maxBytesPerRead=&quot;65536000&quot; maxNameTableCharCount=&quot;65536000&quot; \/&gt;         &lt;\/binding&gt;         &lt;binding name=&quot;WebXML&quot; closeTimeout=&quot;00:01:00&quot; openTimeout=&quot;00:01:00&quot;                  receiveTimeout=&quot;00:20:00&quot; sendTimeout=&quot;00:20:00&quot; maxBufferSize=&quot;65536000&quot;                  maxBufferPoolSize=&quot;524288000&quot; maxReceivedMessageSize=&quot;65536000&quot;&gt;           &lt;readerQuotas maxDepth=&quot;65536000&quot; maxStringContentLength=&quot;65536000&quot;                         maxArrayLength=&quot;65536000&quot; maxBytesPerRead=&quot;65536000&quot; maxNameTableCharCount=&quot;65536000&quot; \/&gt;         &lt;\/binding&gt;       &lt;\/webHttpBinding&gt;     &lt;\/bindings&gt;      &lt;services&gt;       &lt;service name=&quot;SampleService.Calculator&quot;&gt;         &lt;!-- \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 SOAP --&gt;         &lt;endpoint address=&quot;basic&quot; binding=&quot;basicHttpBinding&quot; behaviorConfiguration=&quot;Basic&quot;                   bindingConfiguration=&quot;Basic&quot; name=&quot;Basic&quot; bindingNamespace=&quot;http:\/\/dszss.proitr.ru\/WCF&quot;                   contract=&quot;SampleService.ICalculator&quot; \/&gt;          &lt;!-- \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 REST (\u0444\u043e\u0440\u043c\u0430\u0442 Json) --&gt;         &lt;endpoint address=&quot;json&quot; binding=&quot;webHttpBinding&quot; behaviorConfiguration=&quot;WebJson&quot;                   bindingConfiguration=&quot;WebJson&quot; name=&quot;WebJson&quot; bindingNamespace=&quot;http:\/\/dszss.proitr.ru\/WCF&quot;                   contract=&quot;SampleService.ICalculator&quot; \/&gt;          &lt;!-- \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 REST (\u0444\u043e\u0440\u043c\u0430\u0442 XML) --&gt;         &lt;endpoint address=&quot;xml&quot; binding=&quot;webHttpBinding&quot; behaviorConfiguration=&quot;WebXML&quot;                   bindingConfiguration=&quot;WebXML&quot; name=&quot;WebXML&quot; bindingNamespace=&quot;http:\/\/dszss.proitr.ru\/WCF&quot;                   contract=&quot;SampleService.ICalculator&quot; \/&gt;       &lt;\/service&gt;     &lt;\/services&gt;          &lt;protocolMapping&gt;         &lt;add binding=&quot;basicHttpsBinding&quot; scheme=&quot;https&quot; \/&gt;     &lt;\/protocolMapping&gt;              &lt;serviceHostingEnvironment aspNetCompatibilityEnabled=&quot;true&quot; multipleSiteBindingsEnabled=&quot;true&quot; \/&gt;   &lt;\/system.serviceModel&gt;      &lt;system.webServer&gt;     &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot; \/&gt;     &lt;directoryBrowse enabled=&quot;false&quot; \/&gt;   &lt;\/system.webServer&gt;  &lt;\/configuration&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u0434\u0435\u043b\u044b:<\/p>\n<ul>\n<li><b>system.serviceModel\/behaviors\/endpointBehaviors<\/b> \u2013 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0420\u0430\u043d\u0435\u0435 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0430 \u043e\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u043e\u0442 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0438\u0435\u043d\u0442\u0430 \u0438\u043b\u0438 SoapUI, \u0442\u0435\u043f\u0435\u0440\u044c \u0442\u043e\u0447\u043a\u0438 \u0442\u0440\u0438, \u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043d\u0430\u0434\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435. defaultOutgoingResponseFormat \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u0444\u043e\u0440\u043c\u0430\u0442 \u043e\u0442\u0432\u0435\u0442\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u2014 XML \u0438\u043b\u0438 Json. \u0412 \u0446\u0435\u043b\u044f\u0445 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u043e\u0447\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0444\u043e\u0440\u043c\u0430\u0442\u043e\u0432.<\/li>\n<li><b>system.serviceModel\/bindings<\/b> \u2014 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0437 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, \u0447\u0442\u043e \u0447\u0435\u043c\u0443 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442.<\/li>\n<li><b>system.serviceModel\/services<\/b> \u2014 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u0445 \u0442\u043e\u0447\u0435\u043a. \u0417\u0434\u0435\u0441\u044c \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u044b\u043c\u0438 \u0442\u043e\u0447\u043a\u0430\u043c\u0438. \u0414\u043e \u044d\u0442\u043e\u0433\u043e \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u0430 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0430 \u043a\u043e\u043d\u0435\u0447\u043d\u0430\u044f \u0442\u043e\u0447\u043a\u0430 \u0442\u0438\u043f\u0430 basicHttpBinding, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u0437\u0434\u0435\u043b \u043d\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0441\u044f.<\/li>\n<\/ul>\n<p>  \u041e\u0434\u043d\u043e\u0433\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u0430\u043a\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0430\u043f\u043f\u0438\u043d\u0433\u0438 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 ICalculator. \u041f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 Addition:  <\/p>\n<pre><code class=\"cs\">[OperationContract] [WebInvoke(Method = &quot;GET&quot;, UriTemplate = &quot;Add?a={a}&b={b}&quot;)] double Addition(double a, double b); <\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442 WebInvoke, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u043d HTTP-\u043c\u0435\u0442\u043e\u0434 (GET, POST, PUT \u0438\u043b\u0438 DELETE), \u0430 \u0442\u0430\u043a\u0436\u0435 \u0447\u0430\u0441\u0442\u044c URL, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043c\u0435\u0442\u043e\u0434\u0430. \u0422.\u043a. \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435, \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0431\u044b, \u0434\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b \u043c\u0435\u0442\u043e\u0434, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u043b\u0435\u0448, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">[OperationContract] [WebInvoke(Method = &quot;GET&quot;, UriTemplate = &quot;Add\/{a}\/{b}&quot;)] double Addition(string a, string b); <\/code><\/pre>\n<p>  \u041d\u043e \u0443 \u043d\u0430\u0441 \u0447\u0438\u0441\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 WebInvoke \u0432 \u043f\u0440\u043e\u0447\u0438\u043c \u043c\u0435\u0442\u043e\u0434\u0430\u043c, \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">ICalculator.cs<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text;  namespace SampleService {     [ServiceContract(Namespace = &quot;http:\/\/dszss.proitr.ru\/WCF&quot;)]     public interface ICalculator     {         #region Common Methods          \/\/\/ &lt;summary&gt;         \/\/\/ \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;returns&gt; OK &lt;\/returns&gt;         [OperationContract]         [WebInvoke(Method = &quot;GET&quot;)]         string TestConnection();          #endregion          #region Arithmetic          \/\/\/ &lt;summary&gt;         \/\/\/ \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 1 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 2 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0441\u0443\u043c\u043c\u0430 &lt;\/returns&gt;         [OperationContract]         [WebInvoke(Method = &quot;GET&quot;, UriTemplate = &quot;Add?a={a}&b={b}&quot;)]         double Addition(double a, double b);          \/\/\/ &lt;summary&gt;         \/\/\/ \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c &lt;\/returns&gt;         [OperationContract]         [WebInvoke(Method = &quot;GET&quot;, UriTemplate = &quot;Sub?a={a}&b={b}&quot;)]         double Subtraction(double a, double b);          \/\/\/ &lt;summary&gt;         \/\/\/ \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 1 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c 2 &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 &lt;\/returns&gt;         [OperationContract]         [WebInvoke(Method = &quot;GET&quot;, UriTemplate = &quot;Mul?a={a}&b={b}&quot;)]         double Multiplication(double a, double b);          \/\/\/ &lt;summary&gt;         \/\/\/ \u0434\u0435\u043b\u0435\u043d\u0438\u0435         \/\/\/ &lt;\/summary&gt;         \/\/\/ &lt;param name=&quot;a&quot;&gt; \u0434\u0435\u043b\u0438\u043c\u043e\u0435 &lt;\/param&gt;         \/\/\/ &lt;param name=&quot;b&quot;&gt; \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c &lt;\/param&gt;         \/\/\/ &lt;returns&gt; \u0447\u0430\u0441\u0442\u043d\u043e\u0435 &lt;\/returns&gt;         [OperationContract]         [WebInvoke(Method = &quot;GET&quot;, UriTemplate = &quot;Div?a={a}&b={b}&quot;)]         double Division(double a, double b);          #endregion     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u0447\u0435\u0440\u0435\u0437 URL, \u043d\u0435 \u0441\u0430\u043c\u0443\u044e \u043f\u0440\u0438\u044f\u0442\u043d\u0443\u044e \u043d\u0430 \u0432\u0438\u0434, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435.<\/p>\n<p>  \u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432 XML <a href=\"http:\/\/localhost\/Lesson1\/Calculator.svc\/xml\/Add?a=2&amp;b=3.5\">http:\/\/localhost\/Lesson1\/Calculator.svc\/xml\/Add?a=2&#038;b=3.5<\/a>:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/300\/7a3\/a77\/3007a3a77d0448b8ab7a41bbb89a0772.png\"\/><\/p>\n<p>  \u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u043d\u043e \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0432 Json <a href=\"http:\/\/localhost\/Lesson1\/Calculator.svc\/json\/Add?a=2&amp;b=3.5\">http:\/\/localhost\/Lesson1\/Calculator.svc\/json\/Add?a=2&#038;b=3.5<\/a>:<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/352\/af1\/d56\/352af1d5647f484a9cb14d91e0445ac8.png\"\/><\/p>\n<p>  \u0421\u0430\u043c \u0430\u0434\u0440\u0435\u0441, \u043a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u043f\u0443\u0442\u0438 \u043a \u0441\u0435\u0440\u0432\u0438\u0441\u0443 (http:\/\/localhost\/Lesson1\/Calculator.svc), \u0438\u043c\u0435\u043d\u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 (xml \u0438\u043b\u0438 json) \u0438 \u0447\u0430\u0441\u0442\u0438 \u0430\u0434\u0440\u0435\u0441\u0430 \u0438\u0437 UriTemplate. \u0414\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u0430 TestConnection UriTemplate \u043d\u0435 \u0437\u0430\u0434\u0430\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u2014 \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430: <a href=\"http:\/\/localhost\/Lesson1\/Calculator.svc\/xml\/TestConnection\">http:\/\/localhost\/Lesson1\/Calculator.svc\/xml\/TestConnection<\/a><\/p>\n<p>  <a name=\"links\"><\/a><\/p>\n<h3>7. \u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p><a href=\"#top\">\u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u043a \u043e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u044e<\/a><\/p>\n<p>  \u041a\u043e\u0434 \u043f\u0440\u043e\u0435\u043a\u0442\u0430: <\/p>\n<p>  \u0421\u0441\u044b\u043b\u043a\u0438:  <\/p>\n<ul>\n<li><a href=\"http:\/\/www.soapui.org\/\">SoapUI<\/a> \u2013 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/li>\n<\/ul>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/264889\/\"> http:\/\/habrahabr.ru\/post\/264889\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<br \/>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043a\u0443\u0440\u0441 \u0443\u0440\u043e\u043a\u043e\u0432 \u043f\u043e \u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438 <a href=\"https:\/\/ru.wikipedia.org\/wiki\/Windows_Communication_Foundation\">WCF<\/a> \u0438 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u0430 \u0432 \u043f\u0435\u0440\u0432\u0443\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043d\u0430 \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432 \u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432.<\/p>\n<p>  <a name=\"top\"><\/a>  <\/p>\n<h3>\u041e\u0433\u043b\u0430\u0432\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<ol>\n<li><a href=\"#content\">\u0421\u043e\u0434\u0435\u0440\u0436\u0430\u043d\u0438\u0435 \u0443\u0440\u043e\u043a\u0430<\/a><\/li>\n<li><a href=\"#create\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/li>\n<li><a href=\"#hosting\">\u0420\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/li>\n<li><a href=\"#publish\">\u041f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><\/li>\n<li> <a href=\"#execute\">\u0412\u044b\u0437\u043e\u0432 \u0441\u0435\u0440\u0432\u0438\u0441\u0430<\/a><br \/> \n<ul>\n<li><a href=\"#exeTestClient\">\u041a\u043b\u0438\u0435\u043d\u0442 \u043d\u0430 C#<\/a><\/li>\n<li><a href=\"#exeSoapUI\">SoapUI<\/a><\/li>\n<li><a href=\"#exeWebInvoke\">WebInvoke<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li><a href=\"#links\">\u0418\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438 \u0438 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438<\/a><\/li>\n<\/ol>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-264213","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264213","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=264213"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/264213\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=264213"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=264213"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=264213"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}