📄 ecarduserxmlrpcut.pas
字号:
unit ECardUserXMLRPCUt;
interface
uses
Windows,Dialogs,SysUtils,Classes,ECardXMLRPCUt,SystemInfoUt;
type
TECardUserXMLRPC = class
private
ECU_ServerURL:string;
ECU_ECardXMLRPC: TECardXMLRPC;
{ Private declarations }
public
function ECU_Init:Boolean;
function ECT_Login(IdValue,Password:string; var IdType:array of string):Boolean;
function ECT_Logout:Boolean;
function ECT_ReadUser(UserType,UserID:string;var Reg_UserInfo:TSIU_CL_UserInfo;var ResultCode: array of string):Boolean;
{ Public declarations }
end;
var
ECardUserXMLRPC:TECardUserXMLRPC;
implementation
uses
ConstValueUt;
function TECardUserXMLRPC.ECU_Init:Boolean;
begin
Result:=false;
ECU_ECardXMLRPC:=TECardXMLRPC.Create('');
ECU_ServerURL:=SIU_RD_SystemServerConfig.UserServerURL;
Result:=true;
end;
function TECardUserXMLRPC.ECT_Logout:Boolean;
begin
Result:=false;
try
with ECU_ECardXMLRPC do begin
EC_Request.URL :=ECU_ServerURL;
EC_Request.MethodName := 'user.user_logout';
EC_Request.Params.Param.Clear;
EC_Response.params.param.Clear;
EC_Request.Params.Param.AddString(EC_SID);
EC_Response.ProcessRequest(EC_Request);
if EC_Response.IsFault then
exit;
end;
except
exit;
end;
Result:=true;
end;
function TECardUserXMLRPC.ECT_Login(IdValue,Password:string; var IdType:array of string):Boolean;
var
InfoXml:string;
begin
Result:=false;
try
with ECU_ECardXMLRPC do begin
EC_Request.URL :=ECU_ServerURL;
EC_Request.MethodName := 'user.user_login';
EC_Request.Params.Param.Clear;
EC_Response.params.param.Clear;
EC_Request.Params.Param.AddString(IdType[0]);
EC_Request.Params.Param.AddString(IdValue);
EC_Request.Params.Param.AddString(Password);
EC_Response.ProcessRequest(EC_Request);
if EC_Response.IsFault then
exit
else
begin
InfoXml:=EC_Response.params.param.Strings[0];
DecodeResultErr(InfoXml,IdType);
if IdType[0]='0' then
begin
UserInfoDecode(InfoXml);
EC_SID:=SIU_RD_OPSerInfo.sid;
EC_ID:=SIU_RD_OPSerInfo.uid;
end;
end;
end;
except
exit;
end;
Result:=true;
end;
function TECardUserXMLRPC.ECT_ReadUser(UserType,UserID:string;var Reg_UserInfo:TSIU_CL_UserInfo;var ResultCode: array of string):Boolean;
var
InfoXml:string;
begin
Result:=false;
try
with ECU_ECardXMLRPC do begin
EC_Request.URL :=ECU_ServerURL;
EC_Request.MethodName := 'user.user_read';
EC_Request.Params.Param.Clear;
EC_Response.params.param.Clear;
EC_Request.Params.Param.AddString(UserType);
EC_Request.Params.Param.AddString(UserID);
EC_Request.Params.Param.AddString(EC_SID);
EC_Response.ProcessRequest(EC_Request);
InfoXml:='';
if EC_Response.IsFault then
exit
else
begin
InfoXml:=EC_Response.params.param.Strings[0];
DecodeResultErr(InfoXml,ResultCode);
if ResultCode[0]='0' then
RegUserDecode(InfoXml,Reg_UserInfo);
{if Trim(Reg_UserInfo.U_ID)<>'' then
ResultCode[0]:='0';}
end;
end;
except
exit;
end;
Result:=true;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -