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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:18:01+00:00 2026-05-12T12:18:01+00:00

I have two websites on the same machine. The first (client) references a WCF

  • 0

I have two websites on the same machine. The first (client) references a WCF service on the second site(server).

How do I set the address for the service reference? When moving from development on my local machine to the group development server, how do I change the url for the service? The sites are differentiated by host headers, like
http://dev.admin/…
and
http://dev.public/…

I sense that this can be handled using multiple endpoints, but I’m very new to WCF and really don’t have a clue what I’m doing here.

  • 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-12T12:18:01+00:00Added an answer on May 12, 2026 at 12:18 pm

    After much frustration, I managed to determine that both web.config files (on the client and server, both of which are web apps in this case), the following sections have to be changed:

    Client:

       <client>
          <endpoint 
            address="http://mysite.com:port/services/someservice.svc"
            binding="basicHttpBinding" 
            bindingConfiguration="BasicHttpBinding_ISomeService"
            contract="MyServices.ISomeService" 
            name="BasicHttpBinding_ISomeService" />
    
        </client>
      </system.serviceModel>
    

    Server

     <system.serviceModel>
        <serviceHostingEnvironment>
          <baseAddressPrefixFilters>
            <add prefix="http://mysite.com:port/services"/>
          </baseAddressPrefixFilters>
        </serviceHostingEnvironment>
        <behaviors>
          <serviceBehaviors>
            <behavior name="MyServices.SomeServiceBehavior">
              <serviceMetadata httpGetEnabled="true" />
              <serviceDebug includeExceptionDetailInFaults="false" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <services>
          <service behaviorConfiguration="MyServices.SomeServiceBehavior"
            name="MyServices.SomeService">
              <endpoint address="http://mysite.com:port/services/someservice.svc" 
                        name="endpoint.SomeService"
                        binding="basicHttpBinding" 
                        bindingConfiguration="" 
                        contract="MyServices.ISomeService"/>
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
          </service>
        </services>
      </system.serviceModel>
    

    The thing to note here is that the host address in all three relevant sections (client endpoint address, server baseAddressPrefixFilter value, and server endpoint address) have to match.

    I’m able to switch between servers by modifying these, as long as they match. I would still prefer a way to set this based on which machine the server is running on, but this works for the moment.

    WCF Impressions
    What’s hot: persistent object. The client proxy object (created when you add a service reference) maintains a persistent connection to the service on the server. The service instance referenced by the client proxy maintains its state between calls, which can simplify method signatures and makes the client proxy object, and the service as a whole, much more useful for certain applications. Parameter object types can be shared between the client and server if they’re declared in a common library, meaning that you don’t have to create two very similar classes or wrapper classes to pass non-primitive data structures back and forth.

    What’s not: configuration is a royal pain, poorly documented, and far too involved. Getting this to work in a test/dev/staging/production environment configuration where the service neesd to be aware of its location is frustrating. I’m not convinced that making the service aware of its domain url (rather than, say, a relative path to whatever it’s running on) has any significant benefit, security concerns aside.

    That said, I’m continuing to go down the WCF path as the advantages thus-far outweigh the headaches.

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

Sidebar

Related Questions

I have two websites hosted on the same IIS server. SiteA contains WCF services
Because I have two websites on the same server and domain (different folders) and
I have two websites running on the same IIS instance on the same 2008
We have two subdomains for the same site, we would like that depending on
I actually have two websites on the same domain. say, for example http://www.abc.com/flashsite &
Is it possible to have two virtual directories under the same website in IIS
I have two websites, let's say they're example.com and anotherexample.net . On anotherexample.net/page.html ,
Some background first. I have a .net client agent installed on each of the
My scenario is this - I have two ASP.net websites. Both sites run on
I have two exactly the same web sites hosted in two different machines under

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.