0
WCFDataService를 만들고 wpf 응용 프로그램에서 사용하는 사용자 유효성 검사를위한 사용자 정의 webget methord가 있습니다.WCFDataService 변환 할 수 없습니다.
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("*", EntitySetRights.All);
config.SetServiceOperationAccessRule("ValidateUser", ServiceOperationRights.All);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
config.UseVerboseErrors = true;
}
[WebGet]
public bool ValidateUser(string UserName, string Password)
{
return Convert.ToBoolean(MembershipService.ValidateUser(UserName, Password));
}
클라이언트에 다음 코드가 있습니다.
유형의 개체를 캐스팅 할 수 없습니다 'System.Data.Services.Client.QueryOperationResponse`1는 [선택 System.Boolean]' 'System.IConvertible'입력 :
public Boolean ValidateUser(string UserName, string Password)
{
return Convert.ToBoolean(__context.Execute<Boolean>(new Uri(string.Format("{0}ValidateUser?UserName='{1}'&Password='{2}'", __context.BaseUri, UserName, Password))));
}
나는 오류가 무엇입니까.
이 구글하려고 노력하지만 오류에별로 정보는, 하나는 은 사전에 감사합니다 ..... 나에게 올바른 방향으로, 또는 솔루션, 링크, 기사를 제안 할 수 있습니다하시기 바랍니다.