写两个函数,函数的UriTemplate名称一致!这个方法简单粗暴!
[OperationContract]
[WebInvoke(Method = "POST", UriTemplate = "Fun", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
void Fun1();
[WebInvoke(Method = "POST", UriTemplate = "Fun", RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Bare)]
string Fun(UserInfo userInfo);