简体   繁体   English

Java中的Lotus Domino中的WebService获取客户端的IP地址

[英]WebService in Lotus Domino in Java getting the IP Address of the Client

We have written a webservice provider in Java in Lotus Domino. 我们已经在Lotus Domino中用Java编写了一个Web服务提供程序。 Now we would like to obtain the IP Address of the webservice Consument, but unfortunately this is not easy. 现在,我们想获取网络服务Consument的IP地址,但是不幸的是,这并不容易。

My first try was : 我的第一次尝试是:

 mc = MessageContext.getCurrentContext();
 String remoteAddr = "REMOTE_ADDR?" + mc.getProperty("REMOTE_ADDR");

Second try: 第二次尝试:

String remoteIP = mc.getStrProp(Constants.MC_REMOTE_ADDR);

Not working as well. 不能正常工作。

So i have tried to get all properties available in the MessageContext 所以我试图让所有属性在MessageContext中可用

Iterator x = mc.getPropertyNames();

      while (x.hasNext()) {

        String strX = x.next().toString();

// OutPut of the strX

      }

And the output was: 输出为:

RPC
transport.url

Well, nothing helpfull. 好吧,没有帮助。

Has anybody found a working solution? 有没有人找到可行的解决方案?

According to this blog http://www.unimatrix-0.de/index.php?option=com_content&view=article&id=50:messagecontext-im-domino-webservice&catid=35:webservices&Itemid=55 in the old version there were only a few properties, which were distributed from axis. 根据此博客http://www.unimatrix-0.de/index.php?option=com_content&view=article&id=50:messagecontext-im-domino-webservice&catid=35:webservices&Itemid=55的说法,旧版本中只有几个属性,这些属性是从轴分布的。

Thanx a lot for any idea. 非常感谢任何想法。

WebServiceBase.getAgentSession().getAgentContext().getDocumentContext().getItemValueString("Remote_Addr"); WebServiceBase.getAgentSession()。getAgentContext()。getDocumentContext()。getItemValueString(“ Remote_Addr”);

note: there might be easier way to get AgentContext, but this works. 注意:可能会有更简单的方法来获取AgentContext,但这是可行的。 and as long as it compiles..:-) 并且只要编译即可.. :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM