#1 2015-03-12 14:39:24

jaclas
Member
Registered: 2014-09-12
Posts: 215

Client IP on server side in interface based service

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

#2 2015-03-12 20:32:59

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,662
Website

Re: Client IP on server side in interface based service

Offline

#3 2015-03-13 09:45:50

jaclas
Member
Registered: 2014-09-12
Posts: 215

Re: Client IP on server side in interface based service

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

Board footer

Powered by FluxBB