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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:58:30+00:00 2026-05-26T12:58:30+00:00

I’m just learning wcf and can’t understand one very basic thing. I’m creating a

  • 0

I’m just learning wcf and can’t understand one very basic thing.

I’m creating a WCF service which I want to be hosted in IIS just like web application with it’s own path like http://myhost/myapp/ and everything.

I’m creating the WCF service project in VS, I’ve got an *.svc file describing it, then I define a simple endpoint to it like that:

<endpoint address="" 
          binding="basicHttpBinding" 
          contract="wcf_service_auth.IPshService" />

Then I publish this service like an IIS web application to a virtual directory, let’s assume it’s name psh_pub, so I can access the service via url http://localhost/psh_pub/pshservice.svc/. It shows me WCF greetings page and gives me a link to WSDL, which gives me correct wsdl description.

That’s ok.

The next step – I want to add a MEX endpoint. I add to config:

<endpoint address="mex" 
          binding="mexHttpBinding" 
          contract="IMetadataExchange"/>

That’s ok too, the endpoint is accessible at address http://localhost/psh_pub/pshservice.svc/mex and WcfTestClient.exe gives me correct config from that url.

Here the problem comes.

I have a WCF service working under IIS and I want to add one more endpoint to it. For example let it be a net.tcp endpoint. The IIS is configured by default to accept net.tcp connections at port 808 and I’m adding net.tcp protocol to properties of my web app, and I want to add an endpoint to my service like that:

<endpoint address=""
          binding="netTcpBinding" 
          contract="wcf_service_auth.IPshService"  />

and now I assume that my service should be accessible via the url net.tcp://localhost:808/psh_pub/pshservice.svc. But it’s not. And every “how-to” and manual on the web tells that I should specify full address in the config file like that:

<endpoint address="net.tcp://localhost:808/psh_pub/pshservice.svc" 
          binding="netTcpBinding" 
          contract="wcf_service_auth.IPshService" />

And if I do so, it works. But if host the service in another virtual directory, I’ll need to change the config. If I host it on the other server, I’ll need to change config. If I host it on multiple servers, I’ll have to maintain as many configs as servers I have.

So the main questions is:

Is there any way in WCF to specify a net.tcp (or https) endpoint of a IIS-hosted WCF service without specifying absolute url for it?

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

    You should be able to define a base address for your net.tcp service endpoints:

    <service name="YourServiceName">
       <host>
           <baseAddresses>
              <add baseAddress="net.tcp://localhost:808/psh_pub/" />
           </baseAddresses>
       </host>
    

    Then you should be able to use relative addresses in your actual endpoints:

       <endpoint name="Tcp01"
                 address="pshservice.svc" 
                 binding="netTcpBinding" 
                 contract="wcf_service_auth.IPshService" />
    </service>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I have just tried to save a simple *.rtf file with some websites and
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from

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.