Click here to Skip to main content
12,825,359 members (40,319 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# WCF
I am starting off with WCF and i am following the samples from MSDN. I managed to run the Getting Started sample on one machine as well as by deploying the client & service on separate machines and remotely accessing the service.

My goal is to implement the Publish/Subscribe design pattern. I have managed to run it on one machine without any big issues. But when i am deploying client & service on different machine, my client is unable to connect to the service. I get the following exception:

System.ServiceModel.Security.SecurityNegotiationException was unhandled
  Message=The caller was not authenticated by the service.

(I can share the stack trace if necessary)

Here are my configurations:

Service - web.config
<?xml version="1.0" encoding="utf-8" ?>
      <add scheme="http" binding="wsDualHttpBinding"/>
          <serviceMetadata httpGetEnabled="True"/>
          <serviceDebug includeExceptionDetailInFaults="False" />

Client - app.config
<?xml version="1.0" encoding="utf-8"?>
        <binding name="WSDualHttpBinding_ISampleContract" clientBaseAddress="http://<SERVICE MACHINE PUBLIC IP>:8000/myClient/"
                  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">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00" />
          <security mode="Message">
            <message clientCredentialType="Windows" negotiateServiceCredential="true"
      <endpoint address="http://<SERVICE MACHINE PUBLIC IP>/ServiceModelSamples/service.svc"
          binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_ISampleContract"
          contract="ISampleContract" name="WSDualHttpBinding_ISampleContract">
          <servicePrincipalName value="host/<SERVICE MACHINE PUBLIC IP>" />

I have searched for a solution but nothing has worked for me. I have tried to find a way to disable the security/authentication on the service side (just to get it work), but haven't been successful in that as well.

Any suggestions/solutions would be Hoping to get some positive feedback.

Posted 11-Dec-12 8:36am
Programm3r 12-Dec-12 5:46am
Hi - please have a look at the following:

So your client is accessing the service over Internet? In such case you cannot use Windows security. It works only on local network / same Windows domain. (In this exception you should make security mode in both server and client None)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 11 Dec 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100