How to change from basicHttpBinding to WSDualHttpBinding in WCF service ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 1 Sparrow
    New Member
    • Nov 2011
    • 5

    How to change from basicHttpBinding to WSDualHttpBinding in WCF service ?

    Hi!
    In one MS VS 2013 solution I develop two projects: 1) WCF service with duplex contract and 2) WPF Client for this service. When I try to add service reference to the client then the following error has place: "Contract requires Session, but baseHttpBinding doesn't support it or isn't configured properly to support it". When I change (in App.config file) from basicHttpBindin g to WSDualHttpBindi ng then I get the following error: "binding attribute not valid: WSDualHttpBindi ng value not valid...".
    So how can I change from basicHttpBindin g to WSDualHttpBindi ng?
    I display service's App.config file completely below:

    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    
      <appSettings>
        <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
      </appSettings>
      <system.web>
        <compilation debug="true" />
      </system.web>
        <system.serviceModel>
        <services>
          <service name="DownloadManager.DownloadManagerService">
            <endpoint address="" binding="basicHttpBinding" contract="DownloadManager.IDownloadManagerService">
              <identity>
                <dns value="localhost" />
              </identity>
            </endpoint>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8733/Design_Time_Addresses/DownloadManager/DownloadManagerService/" />
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <serviceMetadata httpGetEnabled="True" httpsGetEnabled="True"/>
              <serviceDebug includeExceptionDetailInFaults="True" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    
    </configuration>
    Below I display contract interface:
    Code:
    [ServiceContract(Namespace="http://DownloadManager",SessionMode=SessionMode.Required,
            CallbackContract=typeof(IDownloadManagerServiceCalback))]
    public interface IDownloadManagerService
    {
      . . . . . . . .
    }
    And below I display calback interface:
    Code:
    public interface IDownloadManagerServiceCalback
    {
            [OperationContract(IsOneWay=true)]
            void UpdateSelectedDownload(Downloader p_SelectedDownload);
    }
Working...