Reference for the bearer mode and selection of the WCF Service

Source: Internet
Author: User

Part 1Article: Typical use cases of WCF (Internet, lan, anonymous, etc.) Summary and examples of http://www.cnblogs.com/2018/archive/2011/02/26/1965569.html

This section describes how to use WCF by category. If the actual development involves deployment, select a deployment method based on the following information.

Deployment method: Self-bearer, IIS bearer, and appfabric bearer

IIS service bearer

Use SVC extension implementation, the following configuration

<Add Path = "*. SVC"

Verb = "*"

Type = "system. servicemodel. Activation. httphandler, system. servicemodel. activation, version = 4.0.0.0, culture = neutral, publickeytoken = 31bf3856ad364e35"

Validate = "false"/>

</Httphandlers>

How to enable IIS to host other protocols such as net. TCP

Two-step Configuration:

Adding net. TCP to website binding

Net. TCP added to supported protocols

Then the added SVC service automatically supports HTTP and net. TCP binding.

Manually set services without SVC files

<Servicehostingenvironment multiplesitebindingsenabled = "true">
<Serviceactivations>
<! -- A service without SVC must be enabled using the net. TCP protocol in IIS. -->
<Add relativeaddress = "demo. SVC" service = "wcfsvc. demowcf"/>
</Serviceactivations>
</Servicehostingenvironment>
<Services>
<Service name = "wcfsvc. demowcf">
<! -- Support different protocols for multiple endpoints -->
<Endpoint address = "ws" binding = "wshttpbinding" name = "HTTP" Contract = "contracts. icarrentalservice"/>
<Endpoint binding = "basichttpbinding" name = "HTTP" Contract = "contracts. icarrentalservice"/>
<Endpoint binding = "nettcpbinding" name = "TCP" Contract = "contracts. icarrentalservice"/>
</Service>
</Services>
<Behaviors>
<Servicebehaviors>
<Behavior>
<Servicemetadata httpgetenabled = "true"/>
</Behavior>
</Servicebehaviors>
</Behaviors

Hosting Selection

select the appropriate deployment method based on the preceding table.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.