How to changed the binding in WCF?

Posted by Prabu_Spark under WCF on 6/5/2013 | Points: 10 | Views : 1444 | Status : [Member] | Replies : 1
Hi sir,
I created wcf service to insert and get the details of employee. Its have the basichttp binding by default, now
i need to change the binding wshttpbinding. I change the web.config like below.

<?xml version="1.0"?>
<compilation debug="true" targetFramework="4.0"/>

--><!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above 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"/>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>-->

<!-- Now editting-->


<serviceMetadata httpGetEnabled="true"/>

<serviceDebug includeExceptionDetailInFaults="false"/>


<binding name="WsHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8"

<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />



<endpoint address="http://localhost:3823/EmpDetails/Service.svc"
binding="wsHttpBinding" bindingConfiguration="WsHttpBinding_IService"
contract="IService" name="WsHttpBinding_IService" />

<modules runAllManagedModulesForAllRequests="true"/>
<add name="con" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\checking.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>

If i test the wcf service using wcftestclient tool, it shows basic http binding. My question is how to change the
binding for that wcf service. Kindly give me the solution for this problem.

With regards,


Posted by: Vuyiswamb on: 7/9/2013 [Member] [MVP] [Administrator] NotApplicable | Points: 25

Look at this

Thank you for posting at Dotnetfunda

Prabu_Spark, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response