Navigation
Links

Powered by Squarespace
« What happened here? | Main | Orcas CTP: Synchronization Services »
Tuesday
Mar132007

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:
<system.serviceModel><services>
<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…

Reader Comments (2)

Nice! This is exactly what I was looking for and couldn't find anywhere!

September 13, 2007 | Unregistered CommenterScott Wojan

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>