title: WCF 3.5 find the url the client used to get to the service (server side)
body: <p>I am trying to find the url the client used to get to the server, (on the server side).  I have tried the following:</p>
  
  <pre><code>Uri url = OperationContext.Current.Channel.RemoteAddress.Uri;
  Uri url = OperationContext.Current.Channel.Local.Uri;
  Uri url = OperationContext.Current.EndpointDispatcher.EndpointAddress.Uri;
  </code></pre>
  
  <p>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.</p>
  
  <p>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.  </p>
  
  <p>The result I want to get (from the server would be):</p>
  
  <p><a href="http://mywebsite.com/myservice.svc" rel="nofollow">http://mywebsite.com/myservice.svc</a></p>
  
  <p>rather than</p>
  
  <p><a href="http://myserver.mydomain.local/myservice.svc" rel="nofollow">http://myserver.mydomain.local/myservice.svc</a></p>
  
  <p>which is what seems to be happening at the moment.</p>