1,593
社区成员
发帖
与我相关
我的任务
分享
..
IWebServiceAPI = interface(IInvokable)
..
function GetIWebServiceAPI(UseWSDL: Boolean; HTTPRIO: THTTPRIO): IWebServiceAPI;
var
RIO: THTTPRIO;
myIni: TiniFile;
cServer, defWSDL, defURL, defSvc, defPrt, Addr: string;
begin
myIni := TIniFile.Create(ExtractFilePath(ParamStr(0)) + 'Param.ini');
cServer := myIni.ReadString('DataSource','Server','');
myIni.Free;
With HTTPRIO do
begin
defWSDL := cServer + RENT_SERVERWSDL;
defSvc := RENT_SERVERSERVICE;
defPrt := RENT_SERVERPORT;
defURL := cServer + RENT_SERVERSOAP;
end;
Result := nil;
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as IWebServiceAPI);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;