WCF Service Project configuration for https
Rowan has spent alot of time on WCF and has a good understanding of WCF services. In this example, I wanted to host a WCF service on a website and use it with https. Below is the configuration necessary to do that.
In web.config file create the serviceBehaviors, bindings, and services section:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="MembershipProviderHelperBehavior">
<serviceMetadata httpsGetEnabled="true" httpsGetUrl="" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="TheConfig">
<security mode="Transport"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="CustomClassHelperBehavior" name="CustomClassHelper">
<host>
<baseAddresses>
<add baseAddress="https://ssl.texmed.org/Services/CustomClassHelper" />
</baseAddresses>
</host>
<endpoint address="" binding="basicHttpBinding" contract="ICustomClassHelper" bindingConfiguration="TheConfig">
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
Leave a Reply
You must be logged in to post a comment.
