tags:

views:

25

answers:

1

I have a simple service and the URL is being generated as:

http://localhost:1234/TestService/TestService.svc

Is there any way to get this to be:

http://localhost:1234/TestService.svc

i.e. to remove the Project name from the URL?

A: 

If the endpoint is implemented in code then you specify the URL in the call to ServiceHost.AddServiceEndpoint(...).

If the endpoint is implemented via configuration then in either the Web or App config look under elements <services><service><host><baseAddresses> and <services><service><endpoint address=''>.

The second is the relative address and will be appended to the base address.

Noel Abrahams
My apologies, this is (at the moment) visual studio hosted.
BlueChippy
There must be an App.config somewhere with the URL.
Noel Abrahams
There is...but I'm looking at an example app from someone else that doesn't have anything obvious in the Web.config...but doesn't put the project name in the URL?
BlueChippy
@BlueChippy, I've updated the response with some information. I hope that helps.
Noel Abrahams