多个请求正文错误

时间:2014-02-21 10:05:39

标签: wcf

应用客户端行为时客户端的实际错误:

  

合同的'GetCurrentStreamPositionByStreamId'操作   'IVideoService'指定多个请求体参数   序列化没有任何包装元素。最多一个身体参数   可以序列化没有包装元素。要么删除额外的   body参数或设置BodyStyle属性   WebGetAttribute / WebInvokeAttribute to Wrapped。

1 个答案:

答案 0 :(得分:0)

通过以下方法在webinvoke属性中指定uritemplate:

       [OperationContract]
       [WebInvoke(
        Method = "GET",
        ResponseFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare,
        UriTemplate = "getcurrenttime/{managerid}/{streamid}")]
        DateTime GetRecordedVideoCurrentTime(string managerid,string streamid);
相关问题