.NET Framework Bookmark and Share   
 index > .NET StockTrader Sample Application > Base Addresses
 

Base Addresses

Hi Greg,

Boy, do I bother you alot...

I have a service that implements two interfaces, IServiceA and IServiceB. They are complementatry, but different, so the scheme makes sense.

I would like to expose them on the endpoints:

http://myServer:20000/MyService/ServiceA
http://myServer:20000/MyService/ServiceB

However, when I add the first endpoint for wsHttp, you must use a base address, so the first endpoint is correct, but when I add the second, since it cannot be a base address, I am left with:

http://myServer:20000/MyService/ServiceA
http://myServer:20000/MyService/ServiceA/ServiceB

Is there a way around this I am missing?

***Edit***
I've decided this probably doesn't matter anyhow...obviously creating a service client on either of the endpoints in the scheme results in both interfaces.

Thanks,
Darren
dbrust
since addresses are always relative in IIS-hosted sites, wrt to the virtual directory; config services always uses a base address + relative address scheme; so you must go with this. The first address for a network scheme is always the base address, every address after that becomes relative to this base.

-Greg
Greg Leake, Microsoft
  • Marked As Answer bydbrust Sunday, June 07, 2009 6:39 PM
  •  
Gregory Leake
since addresses are always relative in IIS-hosted sites, wrt to the virtual directory; config services always uses a base address + relative address scheme; so you must go with this. The first address for a network scheme is always the base address, every address after that becomes relative to this base.

-Greg
Greg Leake, Microsoft
  • Marked As Answer bydbrust Sunday, June 07, 2009 6:39 PM
  •  
Gregory Leake

Hi Greg,

I've never hosted wcf through IIS, so I didn't realize there were restrictions. I usually host the services I run in NT services. I'm used to being able to define a base address for the service, then each contract through an <endpoint> tag with an address attribute which is simply concatenated with the base address, giving each endpoint a unique address based on the base address, while not exactly being the base address. I'll have to keep this quirk in mind if I decide to move into IIS hosting! Not that it's a huge deal anyhow ;)

Thanks,
Darren

dbrust

Cool. I did things this way becuase I wanted to deal with self-hosted and IIS-hosted services in a consistent way. Underneath, there are several differences between hosting WCF in IIS and self-hosting, however.

-Greg


Greg Leake, Microsoft
Gregory Leake

You can use google to search for other answers

Custom Search

More Threads

• ConfigWeb help
• StockTrader, Self hosted Order Processor via wsHttpBinding : The request for security token could not be satisfied because authentication failed.
• Short Cut key Process in windows application
• Could not load file or assembly problem
• WCF Windows Authentication Error
• FQDN Issue
• Is there any intent to add the utilization of the velocity project for distributed cache.
• Object reference not set to an instance of an object.
• direct invocation of a web service
• Download broken?