WCF - WAS Hosting
WCF - WAS Hosting
?To understand the concept of WAS hosting, we need to comprehend how a system is configured and how a service contract is created, enabling different binding to the hosted service.
為了明白WAS托管的概念,我們需要理解一個系統是如何配置的,以及一個服務契約如何被創建的。確保托管服務可以接受不同的綁定
First of all, enable WCF for non-protocols. Before we start creating the service, we need to configure the system to support WAS. Following are the steps to configure WAS:
首先,確保wcf是無協議的。在我們開始創建服務之前,我們需要配置系統來支持WAS。配置WAS的步驟如下
-
Click Start Menu ? Control Panel ? Programs and Features, and click "Turn Windows Components On or Off" in the left pane.
-
Expand "Microsoft .Net Framework 3.0" and enable "Windows Communication Foundation HTTP Activation" and "Windows Communication Foundation Non- HTTP Activation".
-
Next, we need to add Binding to the default website. As an example, we will bind the default website to the TCP protocol. Go to Start Menu ? Programs ? Accessories. Right click on the "Command Prompt", and select "Run as administrator" from the context menu.
-
Execute the following command:
1.開始菜單-->控制面板-->程序和功能,打開或關閉windows功能。
2.展開.net3.0,啟用WCF?HTTP Activation和WCF?Non- HTTP Activation
3.需要給默認的網站添加綁定,例如,我們可以給默認的網站綁定TCP協議。以管理員權限啟動命令提示符
4.執行以下命令
appcmd.exe set site "Default Web Site" -+bindings.[protocol='net.tcp',bindingInformation='808:*'] ? ? //吐槽下,這個命令執行出錯了,我都不知道該怎么解決
This command adds the net.tcp site binding to the default website by modifying the applicationHost.config file located in the "C:\Windows\system32\inetsrv\config" directory. Similarly, we can add different protocols to the default website.
?
Create WAS Hosted Service
Step-1: Open Visual Studio 2008 and click New → WebSite and select WCF Service from the template and Location as HTTP, as shown below:
?
?
?
無力吐槽,后面的是IIS的差不多,關鍵是配置文件看不懂
轉載于:https://www.cnblogs.com/chucklu/p/4630133.html
總結
以上是生活随笔為你收集整理的WCF - WAS Hosting的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Python正则表达式-2
- 下一篇: Fuel 30 分钟快速安装OpenSt