tags:

views:

20

answers:

1

I have a WCF service running under IIS7. It can be accessed just fine at http://myserver.domain.com/myservice.svc

I don't want to change the physical location or name of this file but I want calls to http://myserver.domain.com/this/here to be handled by http://myserver.domain.com/myservice.svc

Is this possible?

A: 

Yes - with .NET 4 you can quite easily - with .NET 3.5, it's possible, but more work.

In .NET 4, you could use file-less activation which allows you to define a logical URL in web.config - no more need for a *.svc file. But in this case, you cannot use the "old" URL with the *.svc file anymore (since there is no SVC file anymore).

<configuration>
  <system.serviceModel>
    <serviceHostingEnvironment>
      <serviceActivations>
        <add relativeAddress="this/here" service="IYourService"/>
      </serviceActivations>
    </serviceHostingEnvironment>
  </system.serviceModel>
</configuration>

Read all about this and other new WCF 4 features at A Developer's Introduction to WCF 4

For .NET 3.5, there's only the way of rewriting your URL's - a rather thorny way to go - read more about it in the MSDN library or see Scott Guthrie's blog post on it.

marc_s
I felt like there had to be a way to do this using WCF in .NET 3.5 Now that I know there isn't I started looking at other options like URL Rewriting. We ended up going with the URL Rewrite Module for IIS7. It seems to be working now. Thanks for your help.
DarenTx