【发布时间】:2013-05-08 10:54:06
【问题描述】:
我正在尝试从客户端接收来自 WCF 方法的答案。当我尝试执行 void 方法时,它们工作正常。例如:
Uri u = new Uri(string.Format(LogIn.ctx.BaseUri + "/CreateRole?name='{0}'",
TextBox1.Text), UriKind.RelativeOrAbsolute);
LogIn.ctx.Execute(u, "GET");
现在我想调用一个返回布尔值的方法,并且将使用这个值。这是我要调用并接收其返回值的方法:
[WebGet]
public bool Controler(string role, string user)
{
if (Roles.IsUserInRole(user, role))
{
return true;
}
else
{
return false;
}
}
【问题讨论】:
-
第二种方法不行吗?如果没有,您能否在您的答案中添加一些解释,说明正在发生什么不正确的行为?我猜客户端没有发回数据?
标签: asp.net wcf wcf-data-services odata