掲示板

Obtain external client IP from web service

thumbnail
11年前 に Dimitrios Karageorgopoulos によって更新されました。

Obtain external client IP from web service

New Member 投稿: 18 参加年月日: 12/06/01 最新の投稿
Dear all,

I have implemented a web service using Service Builder in Liferay 6.0.

I want to obtain the extrnal client's IP addressin my *ServiceImpl class where the implementation of my web service methods reside.

I've seen that PortalUtil has a getHttpServletRequest that can lead to a getRemoteAddr funtion but getHttpServletRequest requires a PorletRequest object as input parameter that I do not know how I can get it from
thumbnail
11年前 に Andew Jardine によって更新されました。

RE: Obtain external client IP from web service

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
The ServiceContext object has a getRemoteAddr() method on it as well. Can you use that one?
thumbnail
11年前 に Dimitrios Karageorgopoulos によって更新されました。

RE: Obtain external client IP from web service

New Member 投稿: 18 参加年月日: 12/06/01 最新の投稿
Hi Andrew,

do you know how I can get a reference to the ServiceContext from my *ServiceImpl.java where my web services reside?
thumbnail
11年前 に Dimitrios Karageorgopoulos によって更新されました。

RE: Obtain external client IP from web service

New Member 投稿: 18 参加年月日: 12/06/01 最新の投稿
I tried a com.liferay.util.axis.ServletUtil which has a getRequest that returns an HttpServletRequest that has a getRemoteAddr() but did not work .
I got a org.apache.catalina.loader.WebappClassLoader.loadClass exception for com.liferay.util.axis.ServletUtil
11年前 に Giuseppe Pantaleo によって更新されました。

RE: Obtain external client IP from web service

New Member 投稿: 15 参加年月日: 12/06/18 最新の投稿
Hi Dimitrios,
have you found a solution for this issue?