Search code examples
c#wcfendpointbase-address

WCF endpoints which work regardless of having a / at the end or not?


Ok so I have configured my WCF service and its all running fine.

Just one quirk that I cant figure out.

I have defined my base address: eg. <add baseAddress="http://localhost:8000/EOSS/"/>

Now if I use http://localhost:8000/EOSS/ it works fine. However if I drop the / to http://localhost:8000/EOSS it doesn't work.

Is there any way to get both to work?


Solution

  • Quoting from http://msdn.microsoft.com/en-us/magazine/cc163412.aspx "You can supply one base address per transport when constructing a ServiceHost object"

    that means that if you want both to work you will need to add another transport with another base address