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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 188k
  • Answers 188k
  • 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 DD and DU anomalies (if I remember correctly—I use FindBugs… May 12, 2026 at 5:33 pm
  • Editorial Team
    Editorial Team added an answer modelshredder has exactly what you need. If you have the… May 12, 2026 at 5:33 pm
  • Editorial Team
    Editorial Team added an answer The target filesystem has to support the encoding as well… May 12, 2026 at 5:33 pm

Related Questions

This is only marginally a programming problem and more of a networking problem. I'm
I just found out about the Yahoo UI Reset CSS tool/file and I'm using
I have a WCF service running on the IIS with a ServiceHostFactory. It's running
I recently had this issue with a client. The code read: ini_set( sendmail_from, noreply@<current-domain>.com

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.