Wednesday, November 11, 2009

Axis 2 get client's IP address

This seems to be the easiest way to do it:

MessageContext msgContext = MessageContext.getCurrentMessageContext();
String ip = (String) msgContext.getProperty(MessageContext.REMOTE_ADDR);


Also required:

import org.apache.axis2.context.MessageContext;

No comments:

Followers