You are not logged in.
Hi,
I need in service method (interface-based service) get client IP. How to do it?
IServiceBase = interface(IInvokable)
function MakeSomething : string;
end;
TServiceBase = class(TInterfacedObject, IServiceBase)
public
function MakeSomething : string;
end;
[...]
ServiceRegister(fServiceBase, [TypeInfo(IServiceBase)]);
[...]
function TServiceBase.MakeSomething : string;
begin
[...] <------------ how get client IP in this place?
end;
best regards
Offline
A little search in the forum:
http://synopse.info/forum/viewtopic.php?id=1799
Offline
Oh, sorry, you are right. Thanks for reply :-)
function TServiceBase.MakeSomething : string;
var
IP : string;
begin
IP := FindIniNameValue(Pointer(ServiceContext.Request.Call.InHead),'REMOTEIP: ');
end;
Offline