I am trying to find the url the client used to get to the server, (on the server side). I have tried the following:
Uri url = OperationContext.Current.Channel.RemoteAddress.Uri;
Uri url = OperationContext.Current.Channel.Local.Uri;
Uri url = OperationContext.Current.EndpointDispatcher.EndpointAddress.Uri;
but none of these seemed to work correctly. They all return the server name, (with the fully qualifed domain. such as myserver.mydomain.local. Even if I used used myserver/myservice.svc it would get the full name.
At this point I don't have a service and domain available to test going to mywebsite.com/myservice.svc to see if it has the machine name or not.
The result I want to get (from the server would be):
http://mywebsite.com/myservice.svc
rather than
http://myserver.mydomain.local/myservice.svc
which is what seems to be happening at the moment.