探知,不断发现
探知不断发现
摘要: 使用WebChannelFactory在net中可以方便构造出 WCF REST使用的客户端,但是这个时候有一个问题,就是当我们的服务端有一些错误的时候,比如验证通不过我们希望可以抛出自定义的异常消息(是我们同一的消息类),这个时候我们会发现客户端无法处理了 他会出现 Unable to deserialize XML body with root name 'ErrorMessage' and root namespace '' (for operation 'Get' and contract ('IService1', 'http://tempuri.org/')) using D 阅读全文
posted @ 2011-02-22 14:12 lovebanyi 阅读(914) 评论(0) 推荐(0) 编辑
摘要: [ServiceContract(Name="Profile")] public interface IProfile { [OperationContract] [WebGet(UriTemplate = "")] ProfileInfo Get(); [OperationContract] [WebInvoke(UriTemplate = "", Method = "PUT")]ProfileInfo Update(ProfileInfo instance); }var httpRequest = (HttpW 阅读全文
posted @ 2011-02-22 14:11 lovebanyi 阅读(944) 评论(5) 推荐(1) 编辑