WCF: Service Name

I’ve been working with a WCF service and wanted to change the name of the service without changing the class name (TypeName). Every example I’ve seen shows that the name of the type equals the name of the service.

The service is hosted in IIS, and the web.config is configured as:
<service name="Namespace.TypeName" …

Filename.svc is configured:
<% @ServiceHost Service="Namespace.TypeName " %>
When you browse to the filename.svc file:

TypeName Service
You have created a service.
To test this service, you will need to create a client and use it to call the service.

After looking through the documentation, I found that the service name is configured through the ServiceBehavior attribute:
[ServiceBehavior (Name = "The name of the service")]
public class TypeName {…

Hope this helps…

One comment on “WCF: Service Name

Comments are closed.