【发布时间】:2009-06-12 06:24:41
【问题描述】:
在 IIS 中命名和托管 WCF 服务端点的最佳做法是什么?
假设一个示例场景:
- 与客户实体打交道的服务
-
Company.Entities.Customer的解决方案命名空间 -
Company.Entities.Customer.ServiceHost包含 IIS 主机(即仅 .svc 文件) -
Company.Entities.Customer.Service包含服务实现(不是托管) -
Company.Entities.Customer.ServiceContracts包含服务合同
你会叫什么:
- a) IIS 中的虚拟目录/网站?
- b) .svc 文件?
作为示例,我目前在以下之间折腾:
- 1) 目前的做法:
- a) http://servername/Company.Entities.Customer/
- b)
CustomerEntities.svc - 端点中的结果:http://servername/Company.Entities.Customer/CustomerEntities.svc
- 2) “更清洁”建议:
- a) http://customhostname/Customer/(例如http://entitiesservices/Customer/)
- b)
Service.svc(因为服务已经在主机名+目录/站点名中定义) - 端点中的结果:http://entitiesservices/Customer/Service.svc
- 3) 上述组合(例如 1a + 2b = http://servername/Company.Entities.Customer/Service.svc)。
【问题讨论】:
标签: wcf iis naming-conventions