WCF wsDualHttpBinding ASP.NET Client Callback is not working
<p><strong>I have Created a simple Callback Service using wsDualHttpBinding and try to call it using ASP.net web application but my problem is the callback event is not getting hit. I have tried it with Console Client and it works fine with it. Please help me what mistake i am doing. I am new to ASP.net</strong></p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Threading;

[ServiceContract(CallbackContract=typeof(IClientCallback))]
public interface ITemperature
{
    [OperationContract(IsOneWay=true)]
    void RegisterForTempDrops();
}

public interface IClientCallback
{   
    [OperationContract]
    bool TempUpdate(double temp);
}

[ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession, ConcurrencyMode = ConcurrencyMode.Reentrant)]
public class Temperature : ITemperature
{
    public void RegisterForTempDrops()
    {
        OperationContext ctxt = OperationContext.Current;
        IClientCallback callBack = ctxt.GetCallbackChannel&lt;IClientCallback&gt;();
        Thread.Sleep(3000); //simulate update happens somewhere; for example monitoring a database field
        callBack.TempUpdate(10);
    }

}
</code></pre>

<p><strong>App.Config</strong></p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;configuration&gt;
  &lt;system.serviceModel&gt;
    &lt;services&gt;
      &lt;service name="Temperature" behaviorConfiguration="ServiceBehavior"&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="http://localhost:5050/duplexservice" /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
        &lt;!-- Service Endpoints --&gt;
        &lt;endpoint address="http://localhost:5050/duplexservice" binding="wsDualHttpBinding" contract="ITemperature" /&gt;
        &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
      &lt;/service&gt;
    &lt;/services&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="ServiceBehavior"&gt;       
          &lt;serviceMetadata httpGetEnabled="true"/&gt;       
          &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
  &lt;/system.serviceModel&gt;
&lt;/configuration&gt;
</code></pre>

<p><strong>Windows Form to run the Service.</strong></p>

<pre><code>using System.Text;
using System.Windows.Forms;
using System.ServiceModel;

namespace DuplexService
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        internal static ServiceHost myServiceHost = null;
        private void button1_Click(object sender, EventArgs e)
        {
            myServiceHost = new ServiceHost(typeof(Temperature));
            myServiceHost.Open();
            MessageBox.Show("Service Started!");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (myServiceHost.State != CommunicationState.Closed)
            {
                myServiceHost.Close();
                MessageBox.Show("Service Stopped!");
            }
        }
    }
}
</code></pre>

<p><strong>ASP.net Client Code</strong></p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DuplexService;
using System.ServiceModel;

public partial class _Default : System.Web.UI.Page, ITemperatureCallback
{
    static InstanceContext site = new InstanceContext(new _Default());
    static TemperatureClient proxy = new TemperatureClient(site);

    public bool TempUpdate(double temp)
    {
        Response.Redirect("Temp dropped to {0} : " + temp);
        return true;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        proxy.RegisterForTempDrops();
    }
}
</code></pre>

<p><strong>Web.Config Code</strong></p>

<pre><code>&lt;?xml version="1.0"?&gt;
&lt;!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  --&gt;
&lt;configuration&gt;
  &lt;system.web&gt;
    &lt;compilation debug="true" targetFramework="4.0"/&gt;
  &lt;/system.web&gt;
  &lt;system.serviceModel&gt;
    &lt;bindings&gt;
      &lt;wsDualHttpBinding&gt;
        &lt;binding name="WSDualHttpBinding_ITemperature" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
          maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
          textEncoding="utf-8" useDefaultWebProxy="true"&gt;
          &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
          &lt;reliableSession ordered="true" inactivityTimeout="00:10:00" /&gt;
          &lt;security mode="Message"&gt;
            &lt;message clientCredentialType="Windows" negotiateServiceCredential="true"
              algorithmSuite="Default" /&gt;
          &lt;/security&gt;
        &lt;/binding&gt;
      &lt;/wsDualHttpBinding&gt;
    &lt;/bindings&gt;
    &lt;client&gt;
      &lt;endpoint address="http://localhost:5050/duplexservice" binding="wsDualHttpBinding"
        bindingConfiguration="WSDualHttpBinding_ITemperature" contract="DuplexService.ITemperature"
        name="WSDualHttpBinding_ITemperature"&gt;
        &lt;identity&gt;
          &lt;userPrincipalName value="smdunk" /&gt;
        &lt;/identity&gt;
      &lt;/endpoint&gt;
    &lt;/client&gt;
  &lt;/system.serviceModel&gt;
&lt;/configuration&gt;
</code></pre>
