Flex扩展HTTPService简化调用接口定义
2009-02-11 11:57:16 来源:WEB开发网var send:ILogin =new ILogin();
send.UserName= txtName.text;
send.UserPWD=txtPWD.text;
send.ImgKey= ic.ImageKey();
send.ImgSN=ic.ImageSN();
send.Open();
服务端代码
对于服务端代码就可以根据自己需来处理,jsp,asp,asp.net,php都是一样只要接收http请求即可。为了便于理解把服务端代码顺便贴出来:
[NClay.Web.Service.ActionMapper]
public class UserLogin : ActionBase
{
protected override void OnGet()
{
ImageValidate.Check();
User user= _UserService.Login(UserName, UserPWD);
if(user ==null)
throw new Exception("用户名或密码不正确!");
if (user != null && !user.Enabled)
throw new Exception("用户已经被系统禁用,请与管理员联系!");
mLoginer = user;
mIsLogin = mLoginer != null;
FormsAuthentication.SetAuthCookie(Loginer.UserName, true);
LoginID = Loginer.UserID;
LoginName = Loginer.UserName;
base.OnGet();
}
public string UserName
{
get;
set;
}
public string UserPWD
{
get;
set;
}
[NClay.Web.Service.OutputXml]
public int LoginID
{
get;
set;
}
[NClay.Web.Service.OutputXml]
public string LoginName
{
get;
set;
}
public NClay.Web.Actions.ImageValidate ImageValidate
{
get;
set;
}
}
Tags:Flex 扩展 HTTPService
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接