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 597655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:18:15+00:00 2026-05-13T16:18:15+00:00

I’m currently implementing a WCF REST service on a web role in Windows Azure,

  • 0

I’m currently implementing a WCF REST service on a web role in Windows Azure, and I’m trying to add some communication between the instances of the role so that they can keep each other updated when, say, some data is updated in blob storage. What I’d like to do is host the same WCF service on both the external and internal HTTP endpoints of the web role. However, from what I’ve read, WCF is limited to just one base address per protocol when hosted in IIS. When I enable the internal HTTP endpoint for my role and try to start up my service using the WebServiceHostFactory, this is the error I get:

This collection already contains an
address with scheme http. There can
be at most one address per scheme in
this collection.

Parameter name: item

I’ve Googled around a bit, and the one workaround I’ve seen in various places suggests adding a baseAddressPrefixFilter in the web.config. However, if I don’t know the full URL for either endpoint before I run the app, I’m not sure how to get that to work.

Alternatively, this issue seems constrained to just IIS hosting, so is there some other hosting method I could use in Azure that would work? I would think self-hosting outside of any IIS context or whatever wouldn’t be robust/secure enough, but I don’t know for sure.

Does anyone know how to get around this issue? It seems like it would be a pretty common thing to want to host a web service on both endpoints of a web role. I’m relatively new to WCF, so there may be something obvious I’m missing. Any help is appreciated.

  • 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-13T16:18:15+00:00Added an answer on May 13, 2026 at 4:18 pm

    I finally figured this out on Friday. I’ll try and give a more detailed answer and/or blog about this later, but for now, here’s a summary of the solution I came up with:

    • I don’t have a system.serviceModel section in the web.config file at all. There may be some parts of this you can configure through the web.config, but doing it all in code was just easier for me.
    • Each endpoint has to be on its own service. When both endpoints are using the same protocol (HTTP, in this case) and you’re trying to host on IIS, there’s really no easy way around this.
    • Each service has to have its own .svc file. I’ve heard that supposedly a .svc file isn’t necessary for hosting in IIS, but if that’s true, I haven’t seen any other way to make it work.
    • Each service also has its own custom service host factory. In the factory, when creating the host, I used the base address parameter whose port matched up to the endpoint I wanted to use. I’m told this base address doesn’t actually matter, but I can’t vouch for that myself. Then when creating the endpoint, just use an empty string for the endpoint address.
    • Since I wanted to make a REST service, I would usually use WebServiceHost, but that was causing some various problems, so I just used ServiceHost instead and added the WebHttpBinding and WebHttpBehavior to the endpoint manually.
    • Finally, when calling the internal service from the external one, I had to make sure to surround the call with a new operation context scope, like so:
    
    using (new OperationContextScope((IContextChannel)myClientFromChannelFactory))
    {
        myClientFromChannelFactory.MyServiceMethod();
    }
    
    

    I asked a similar question on the MSDN Windows Azure forums and got some of the information there, so there may be some more helpful info there.

    Hope that helps anyone else out there who runs into the same issue.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I have a bunch of posts stored in text files formatted in yaml/textile (from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm making a simple page using Google Maps API 3. My first. One marker

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.