WCF configuration under IIS using SSL (CSDN Manual migration)

Source: Internet
Author: User

Configure the HTTP binding in WCF Webconfig and set it to use transport security as follows

 1  <bindings>2  <basichttp Binding>3  <binding name= " securehttpbinding   >4  <s ecurity mode=  " >5  <transport clientcredentialtype= " none  " />6  </security>7  </binding>8  </basichttpbinding>9  </bindings> 

Specifying service and service endpoints

1<services>2<service name="WCF. Service">3<endpoint contract="WCF. IService"address=""binding="BasicHttpBinding"bindingconfiguration="securehttpbinding"></endpoint>4<endpoint address="Mex"binding="mexhttpsbinding"contract="IMetadataExchange"/><!--here to fix it--5</service>6</services>

The complete webconfig is as follows:

1<?xml version="1.0"encoding="Utf-8"?>2<configuration>3   4<system.web>5<compilation targetframework="4.0"/>6</system.web>7<system.serviceModel>8   9<bindings>Ten<basicHttpBinding> One<binding name="securehttpbinding"> A<security mode="Transport"> -<transport clientcredentialtype="None"/> -</security> the</binding> -</basicHttpBinding> -</bindings> -        +<services> -<service name="WCF. Service"> +<endpoint contract="WCF. IService"address=""binding="BasicHttpBinding"bindingconfiguration="securehttpbinding"></endpoint> A<endpoint address="Mex"binding="mexhttpsbinding"contract="IMetadataExchange"/><!--here to fix it-- at</service> -</services> -    -<behaviors> -<serviceBehaviors> -<behavior> in<!--to avoid leaking metadata information, set the following values before deployment tofalse- -<servicemetadata httpsgetenabled="true"/> to<!--to receive the fault exception details for debugging, set the following values totrue。 Before deployment, set tofalseTo avoid leaking exception information-- +<servicedebug includeexceptiondetailinfaults="false"/> -</behavior> the</serviceBehaviors> *</behaviors> $       Panax Notoginseng<servicehostingenvironment multiplesitebindingsenabled="true"/> -</system.serviceModel> the<system.webServer> +<modules runallmanagedmodulesforallrequests="true"/> A<!-- the to browse the Web application root directory during debugging, set the following value to True.  + Setting this value to False prior to deployment avoids revealing WEB application folder information.  -- $<directorybrowse enabled="true"/> $</system.webServer> -    -</configuration>

WCF configuration under IIS using SSL (CSDN Manual migration)

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.