I am trying to run the Chat application using WCF and WPF. But when I run the service I am getting the error
"Contract requires Duplex, but Binding 'WSHttpBinding' doesn't support it or isn't configured properly to support it"
Can please guide me how to set my web.config file so that I can able to run the program. How to set the
<
appSettings>
<
add key="addr" value="net.tcp://localhost:4445/WcfChatter/ChatService.svc"/>
</
appSettings>
I have put the value "net.tcp://localhost:4445/WcfChatter/ChatService.svc" as I got the url from my browser when I run the service i.e. http://localhost:4445/WcfChatter/ChatService.svc
please reply me as soon as possible.
Below is my web.config file.
<?
xml version="1.0"?>
<
configuration>
<
appSettings>
<
add key="addr" value="net.tcp://localhost:4445/WcfChatter/ChatService.svc"/>
</
appSettings>
<
system.serviceModel>
<
services>
<
service behaviorConfiguration="MyBehavior"
name="WcfChatterService.ChatService">
<
endpoint address="" binding="wsHttpBinding" contract="WcfChatter.IChat">
<
identity>
<
dns value="localhost" />
</
identity>
</
endpoint>
<
endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</
service>
<!--
<service name="ChatService" behaviorConfiguration="MyBehavior">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="DuplexBinding" contract="IChat"/>
--><!--<host>
<baseAddresses>
<add baseAddress="net.tcp//localhost:4445/WcfChatter/"/>
</baseAddresses>
</host>
--><!--
</service>
-->
</
services>
<
behaviors>
<
serviceBehaviors>
<
behavior name="MyBehavior">
<
serviceThrottling maxConcurrentSessions="10000"/>
</
behavior>
</
serviceBehaviors>
</
behaviors>
<
bindings>
<
customBinding>
<
binding name="customReliableHttpBinding">
<
reliableSession ordered="true" />
<
textMessageEncoding messageVersion="Default" />
<
httpTransport />
</
binding>
</
customBinding>
<
netTcpBinding>
<
binding name="DuplexBinding" sendTimeout="00:00:01">
<
reliableSession enabled="true"/>
<
security mode="None"/>
</
binding>
</
netTcpBinding>
</
bindings>
<
protocolMapping> <add scheme="http" binding="wsHttpBinding"/> </protocolMapping>
</
system.serviceModel>
<
system.web>
<
compilation debug="true"/></system.web></configuration>