Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 873427
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:55:59+00:00 2026-05-15T10:55:59+00:00

I maintain a program that sends messages between users. The clients connect to a

  • 0

I maintain a program that sends messages between users. The clients connect to a WCF-service that is hosted in IIS 7.0 on my domainserver. Up to now I successfully used basicHttpBinding for this, without any configuration. Now, I want to change to wsHttpBinding because this should encrypt the transport of the messages. The server has a certificate installed, but I did nothing to make this work with the WCF service. I did not configure any options for the wsHttpBinding either.

Now, when I connect to the WCF-service from any client that is within the domain that is governed by the same server that hosts the WCF-service all is well. But when I try to connect to the service from a client outside the domain the connection fails. The client gets an exception stating that “the caller was not authenticated by the service”. So it must be an authentication problem.

How do I troubleshoot this? A pointer to some helpful resources about this subject is very welcome too.

EDIT:
So here is how I got it working. Hopefully it will save some of you a headache…

The problem was as follows:

  • IIS hosted two websites: mydomain.com and http://www.mydomain.com
  • I wanted to host the WCF service on http://www.mydomain.com as I had purchased a certificate for that URL.
  • WCF threw the error ‘This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.’ at me.
  • you have to solve this by adding a baseAddressPrefixFilter
  • I wanted just transport security, no User Authentication
  • After I solved that one I got an error stating that: ‘The provided URI scheme ‘https’ is invalid; expected ‘http’
  • This error is generated by the client, not by the server.

Here is the web.config that did the trick:

<system.serviceModel>
     <serviceHostingEnvironment>
        <baseAddressPrefixFilters>
          <add prefix="http://www.mydomain.com"/>
        </baseAddressPrefixFilters>
     </serviceHostingEnvironment>

    <services>
      <service behaviorConfiguration="ServiceBehavior" name="MyApp.MyService">
        <endpoint address="mex"
                  binding="mexHttpsBinding"
          contract="IMetadataExchange"
           />
    <endpoint address="wsHttp"
          binding="wsHttpBinding"
                  bindingConfiguration="NoAuthentication"
                  contract="MyApp.IContract"/>
      </service>
    </services>
    <bindings>
    <wsHttpBinding>
        <binding name="NoAuthentication">
         <security mode="Transport">
            <transport clientCredentialType="None"/>
          </security>
        </binding>
    </wsHttpBinding>
   </bindings>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpsGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

Last, but very important: I had to tell the client that it should use the transportsecurity mode too, as I did not create the client with svcutil.

 public static IContract GetContract()
        {
            var binding = new WSHttpBinding(SecurityMode.Transport) {MaxReceivedMessageSize = 655350};
            var factory = new ChannelFactory<IContract>(
                          binding,
                          new EndpointAddress(@"https://www.mydomain.com/MyService.svc/wsHttp"));
            return factory.CreateChannel();
        }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T10:56:00+00:00Added an answer on May 15, 2026 at 10:56 am

    This is the expected default behavior. WsHttpBinding by default will use Windows credentials for authenticating your callers. This works in your domain – but fails outside it.

    What you need to do is either have a second endpoint that also uses the wsHttpBinding, but different security settings, or you need to switch the entire authentication mechanism to something that works inside and outside your domain – either username/password against e.g. ASP.NET membership system on your server-side, or you’ll need to install a certificate on the caller’s machines.

    Update: the ultimate reference would be the WCF Security Guidance on Codeplex which has plenty of How-To’s and Step-by-Step instructions on how to do specific security-related operations in WCF.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 460k
  • Answers 460k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer One easy way would be to add RewriteCond %{HTTP_HOST} !svn.mydomain.com… May 15, 2026 at 11:53 pm
  • Editorial Team
    Editorial Team added an answer Framework Some predefined architecture that a developer has chosen and… May 15, 2026 at 11:53 pm
  • Editorial Team
    Editorial Team added an answer In particular, how does one apply a negative to an… May 15, 2026 at 11:53 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.