摘要:
1通过WebClient或者Request实现,此方法略去2通过WCF Client调用 a通过WebChannelFactory建Channel b通过Channel就可以直接调用服务端方法3代码WCF服务端和客户端都引用Contact库[ServiceContract] public interface IUserService : IBaseWCFService { [WebGet(UriTemplate = "userID={userID}")] [Description("根据UserID获取用户信息")] UserInfo GetUserIn 阅读全文
摘要:
WCF通过Web.config设置,1automaticFormatSelectionEnabled项便可实现返回内容自动根据Content-Type和Accept 返回JSON或者XML2helpEnabled="true"实现HelpPage,在接口加Description特性<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpo 阅读全文