创建WCF Service步骤

1) Define data & service contracts
    Import: System.ServiceModel / System.Runtime.Serialization
    Define data transfer entity and annotate [DataContract] [DataMember]
    Define service interface and annotate [ServiceContract] [OperationContract]
    注:ServiceContract(Name="...", Namespace="...") 
          DataContract(Name="...", Namespace="...")
          其中Name的作用是什么?Namespace的作用是什么?在同一个Service中ServiceContract的Namespace和DataContract的Namespace是否可以不同?
2) Implementing service contracts
    注:[ServiceBehavior(InstanceContextMode=InstanceContextMode.Single)]的实现方式,Singleton是在ServiceHost中实现的吗?
3) Hosting services in your applications
4) Configuration Service Using Configuration Files or In code

你可能感兴趣的:(service)