我正在尝试从客户端接收来自 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;
}
}