locked
WCF Duplex without authentication RRS feed

  • Question

  • This is about a Duplex communication issue on WCF :

    I want my client application to listen to events from the server application. The server application is on internet on a windows server 2008 R2. This remote windows's firewall allow every access from my server application.

    I don't want any authentication process (login, password).

    Most of the time I have this error :

    the caller was not authenticated by the service

    Or I have a strange timeout.

    As you can see, my application works on local, but doesn't work if the server is hosted online (on a windows server for example).

    My server app.config :
    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
    
      <system.serviceModel>
        <services>
          <service name="WCFDuplex.CEventPublisher" behaviorConfiguration="SB">
            <endpoint name="dual" binding="wsDualHttpBinding" contract="WCFDuplex.IEventPublisher"/>
            <endpoint name="mex"  address="mex" binding="mexHttpBinding"  contract="IMetadataExchange" />
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name="SB">
              <serviceDebug includeExceptionDetailInFaults="true"/>
              <serviceMetadata httpGetEnabled="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <bindings>
          <netTcpBinding>
            <binding name="reliabletcp" closeTimeout="00:05:00" openTimeout="00:05:00" sendTimeout="00:05:00">
              <reliableSession enabled="true" ordered="true" inactivityTimeout="00:05:00"/>
            </binding>
          </netTcpBinding>
          <wsDualHttpBinding>
            <binding name="dual" clientBaseAddress="http://localhost:4001/PublisherAT">
            </binding>
          </wsDualHttpBinding>
        </bindings>
      </system.serviceModel>
    </configuration>

    My client app.config :

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <startup> 
            <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
        </startup>
      <system.serviceModel>
        <bindings>
          <wsDualHttpBinding>
            <binding name="dual" clientBaseAddress="http://localhost:4001/PublisherAT"/>
          </wsDualHttpBinding>
        </bindings>
        <client>
          <endpoint address="http://localhost:4000/PublisherAT" binding="wsDualHttpBinding"
            bindingConfiguration="dual" contract="DuplexServer.IEventPublisher" name="dual" />
        </client>
      </system.serviceModel>
    </configuration>

    Here is the link you can use to download my dummy WCF Project

    http://www.wikiupload.com/30FAPIARWUE1ATF

    Can you help me to make this works please.

    Wednesday, August 20, 2014 4:42 PM