简体   繁体   中英

WebService in Lotus Domino in Java getting the IP Address of the Client

We have written a webservice provider in Java in Lotus Domino. Now we would like to obtain the IP Address of the webservice Consument, but unfortunately this is not easy.

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

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.

Thanx a lot for any idea.

WebServiceBase.getAgentSession().getAgentContext().getDocumentContext().getItemValueString("Remote_Addr");

note: there might be easier way to get AgentContext, but this works. and as long as it compiles..:-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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