Tuesday, 17 September 2013

How to set the config in wcf for https?

How to set the config in wcf for https?

I have the following config file for wcf work prefectly under http, but
somehow this is not working unser https. Does anyone know what is going
wrong there? and how can I fix it?
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<bindings>
<!-- if using basicHttpBinding, wsHttpBinding section should be
commented -->
<wsHttpBinding>
<binding name="wsHttpBindingConfig">
<security mode="None">
<transport clientCredentialType="None"
proxyCredentialType="None" />
<message clientCredentialType="None"
negotiateServiceCredential="False" algorithmSuite="Default"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
<services>
<service name="SEWebService.Service1"
behaviorConfiguration="SEWebService.Service1Behavior">
<!-- basicHttpBinding is SOAP-based Service, it sends data in
plain text, but it supports maximum types of clients.
It supports Soap 1.1, lower version of .Net Client, like .Net 1.1 -->
<!--
<endpoint address="basic" binding="basicHttpBinding"
contract="SearchApi.ISearchApi"/>
-->
<!--wsHttpBinding is SOAP-based Service, it sends encrypted data
by default, but it needs supporting WS-* specification clients and
at least .Net3.0 or higher version
By default wsHttpBinding uses Windows authentication, we need to
turn it off by using bindingConfiguration-->
<endpoint address="ws" binding="wsHttpBinding"
contract="SEWebService.IService1"
bindingConfiguration="wsHttpBindingConfig" >
</endpoint>
<!-- webHttpBinding is non-SOAP HTTP services, here webHttpBinding
register REST to be a Restful WCF Service
It uses [WebGet] or [WebInvoke] to map an Http Request to a WCF
operation-->
<endpoint address="" binding="webHttpBinding"
contract="SEWebService.IService1" behaviorConfiguration="REST">
<!--Upon deployment, the following identity element should be
removed or replaced to reflect the identity under which the
deployed service runs.
If removed, WCF will infer an appropriate identity
automatically.-->
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="SEWebService.Service1Behavior">
<useRequestHeadersForMetadataAddress>
<defaultPorts>
<add scheme="http" port="80" />
<add scheme="https" port="443" />
</defaultPorts>
</useRequestHeadersForMetadataAddress>
<!-- To avoid disclosing metadata information, set the value
below to false before deployment -->
<serviceMetadata httpGetEnabled="true"/>
<!-- To receive exception details in faults for debugging
purposes, set the value below to true. Set to false before
deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="REST">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<!--
To browse web app root directory during debugging, set the value
below to true.
Set to false before deployment to avoid disclosing web app folder
information.
-->
<directoryBrowse enabled="true"/>
</system.webServer>
<connectionStrings>
<add name="DbConnectionString" connectionString="nitial
Catalog=Smart_Web_Service;uid=SmartWebService_User;pwd=dzB3RiCK2zb73E;Connect
Timeout=10; pooling=true;" providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>

No comments:

Post a Comment