首页 技术 正文
技术 2022年11月10日
0 收藏 462 点赞 4,069 浏览 1537 个字

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的差不多,关键是配置文件看不懂

上一篇: .NET之特性和属性
下一篇: LA_3026_Period_(kmp)
相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,022
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,513
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,359
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,142
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,773
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,851