Enable WCF services for HTTPS Protocol

Standard

Once we had a service built on WCF framework in HTTP protocol, later on when client’s web based application is available on HTTPS after inclusion of SSL certificate, this service results in mixed mode computability issue for users. However this issue was resolved by defining a separate end point in webconfig file for HTTPS protocol.

<system.serviceModel>
<services>
<service name=”Service.eService” behaviorConfiguration=”DefaultServiceBehavior”>
<endpoint binding=”webHttpBinding” contract=”Service.IService”                          behaviorConfiguration=”DefaultEPBehavior” bindingConfiguration=”HTTPsBinding” />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name=”DefaultEPBehavior”>
<webHttp/>
<CorsSupport/>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name=”DefaultServiceBehavior”>
<serviceMetadata httpGetEnabled=”true”/>
<serviceDebug includeExceptionDetailInFaults=”true”/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name=”HTTPsBinding”>
<security mode=”Transport”>
</security>
</binding>
</webHttpBinding>
</bindings>
<extensions>
<behaviorExtensions>
<add name=”CorsSupport” type=”Service.CorsSupportBehaviorElement, App_Code”/>
</behaviorExtensions>
</extensions>
<serviceHostingEnvironment multipleSiteBindingsEnabled=”true”/>
</system.serviceModel>

 

Note: Key thing to mention here is to define a new endpoint for HTTPS domain in web config of WCF project, bindingConfiguration=”HTTPsBinding” this will do the magic !!!

Advertisements

One thought on “Enable WCF services for HTTPS Protocol

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s