小编Exc*_*ior的帖子

WCF Rest涉及复杂类型的参数

设置使用webHttpBinding的WCF服务...我可以从XML方法返回复杂类型.如何将复杂类型作为参数?

[ServiceContract(Name = "TestService", Namespace = "http://www.test.com/2009/11")]
public interface ITestService
{
    [OperationContract]
    [WebInvoke(Method = "POST", 
               BodyStyle = WebMessageBodyStyle.Bare, 
               UriTemplate = "/Person/{customerAccountNumber}, {userName}, {password}, {PersonCriteria}")]
    Person SubmitPersonCriteria(string customerAccountNumber, 
                                string userName, 
                                string password, 
                                PersonCriteria details);
}
Run Code Online (Sandbox Code Playgroud)

由于UriTemplate只允许字符串,最佳做法是什么?这个想法是客户端应用程序将向服务发布请求,例如一个人的搜索条件.该服务将使用包含XML数据的相应对象进行响应.

xml rest wcf

7
推荐指数
1
解决办法
2万
查看次数

标签 统计

rest ×1

wcf ×1

xml ×1