7.3. No SVC File

WCF4 gives you control over the endpoint exposed for web-based services, allowing you to hide the internal representation of your services, do away with the pesky .svc extension in the service address, and create REST-friendly URLs (note that WCF probably isn't the best framework for REST services—you would probably be better off using ASP.NET MVC).

To see this great new feature, create a new WCF service application (under the web templates section) called Chapter7.Fileless, open web.config, and add the following section inside the system.serviceModel section:

<serviceHostingEnvironment>
   <serviceActivations>
    <add relativeAddress="ICouldBeAnything.svc" service="Chapter7.Fileless.Service1"/>
   </serviceActivations>
</serviceHostingEnvironment>

This configuration will route requests to ICouldBeAnything.svc through to your service. Press F5 to run your application and change the URL to ICouldBeAnything.svc (e.g., http://localhost:52458/ICouldBeAnything.svc), and you should see the service metadata appear.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.10.45