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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:12:52+00:00 2026-05-20T14:12:52+00:00

I have a WCF Service started by code (by creating a BasicHttpBinding, a ServiceHost,

  • 0

I have a WCF Service started by code (by creating a BasicHttpBinding, a ServiceHost, and so on). The WSDL published by this service, however, has its hostname hardcoded. I.e. I tell the service that it runs on example.com and the WSDL will have imports such as

<xsd:import schemaLocation="http://example.com:8018/MyService" etc etc>

Now, from example.com itself I may wish to refer to this service by http://localhost:8018/MyService instead of example.com. However, the xsd imports will still refer to the preconfigured address.

Isn’t there a way to make the service use whichever host the WSDL page was called by inside the WSDL? Or just use a relative address? (assuming clients support that; I’m not actually sure)

The reason why this matters is that the service is addressed by servers in the same server park through its internal IP address, but by external services through its external hostname. We’d like to avoid all traffic going out of and into the subnet again simply because we can’t get WCF to understand that it may have different hostnames. Our current solution is the modify the hosts file in internal clients to make the external hostname point to the internal IP, but this is messy and error prone when e.g. changing server settings or upgrading.

  • 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-20T14:12:53+00:00Added an answer on May 20, 2026 at 2:12 pm

    This should be solved by using useRequestHeadersForMetadataAddress service behavior.

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

Sidebar

Related Questions

I have simple WCF Service Application (based on this tutorial : Getting Started ).
I have started recieving this error in my WCF service for reasons I cannot
I currently have a WCF Service Library which will be started through a Console
I have a wcf service defined like this: [OperationContract] [WebInvoke(Method = POST, ResponseFormat =
I have a WCF service that needs to hosted using basicHttpBinding using SSL. So
We have a WCF service, hosted on IIS7.5, that has to fetch some data
I have the following code in WCF service to throw a custom fault based
I have simple application from this tutorial: WCF 4 Getting Started Tutorial How can
I have exposed my REST API service using WCF Service Library and started by
I have a WCF web service. This web service should only allow certain client

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.