WCF uses NET.TCP to host to IIS (GO)

Source: Internet
Author: User

First, the IIS section

Environment: Windows Server R21. Install was as shown in:2. Web site NET.TCP protocol binding as shown in: 3. The website enables net.tcp as shown in: Second, the WCF code part1.designcaseservice.svc
    1. <% @ServiceHostLanguage ="C #" debug="true" service="  Web.API.Implementations.DesignCaseService"%>        
2.web.config Configuration Example:
<system. ServiceModel>    <Services>      <Servicename= "Web.API.Implementations.DesignCaseService" >        <Endpointbinding= "NetTcpBinding"Address=""Contract= "Web.API.Interfaces.IDesignCaseService" />        <EndpointAddress= "Mex"binding= "Mextcpbinding"Contract= "IMetadataExchange"/>        <Host>          <baseaddresses>            <Addbaseaddress= "Net.tcp://localhost/designcaseservice"/>          </baseaddresses>        </Host>      </Service>    </Services>    <Bindings>      <nettcpbinding>        <bindingportsharingenabled= "true"></binding>      </nettcpbinding>    </Bindings>    <Behaviors>      <servicebehaviors>        <Behavior>          <!--very Important -          <!--to avoid leaking metadata information, set the following values to false before deployment -          <Servicemetadatahttpgetenabled= "false"httpsgetenabled= "false"/>          <!--to receive the fault exception details for debugging, set the following value to True. Set to false before deployment to avoid leaking exception information -          <ServicedebugIncludeexceptiondetailinfaults= "false"/>        </Behavior>      </servicebehaviors>    </Behaviors>  </System.ServiceModel>

3. Publish the service, the box is very important, must be net.tcp4. Testing Servicesthree, the error collection1. The base address that matches the schema net.tcp for the endpoint with the bound nettcpbinding is not found. The registered base address scheme is [HTTP]. Cause: The site is not configured with the NET.TCP protocol, the site default only HTTP protocolSolution: Follow the first section to configure the NET.TCP protocolquestion: The site correctly configured the net.tcp protocol, also reported this error? possible cause: The port is not correct, such as Port 1000 of the NET.TCP protocol configured in IIS, it is possible to right-open the Svc file in Visul Studio and assign another port, such as 2000, which may cause this problemSolution: Open the Svc file in IIS 2. An attempt to create an unreachable is not supported. NET Framework services, you may encounter HTTP endpoints. Requires record type "Preambleack" to find " the"Cause:
<httpgetenabled= "true" httpsgetenabled= "true"     
When HTTP metadata is enabled in the default configuration, a metadata link to the HTTP protocol appears on the Publishing Service page, as shown in:we're using the NET.TCP protocol, and here we're showing the HTTP protocol .Solution:
<servicemetadata httpgetenabledhttpsgetenabled= "false"    

3. Unable to connect because the target computer was actively refused. View nettcpportsharing, net.tcp Listener Adapter service is started

WCF uses NET.TCP to host to IIS (GO)

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.