How to get client IP address in webMethods service

I want to get client IP address that connect to webMethods service,how can I do?

InvokeState.getCurrentState().getProtocolInfoIf().getProtocolProperty(“transport”);

will give you a record that has a lot of info including the ip address of the client.

Good solution, Rupinder. Here is the full code to support it.

  1. Create a new Java service with no inputs and one output. The output is a Record named user []Go to the Shared tab of the Java service and import "com.wm.app.b2b.server. [*]Go to the Source tab and paste the following code:
 
InvokeState is = new InvokeState(); 
 
// pipeline 
User user = new User(); 
user = (is.getCurrentUser());  
 
// pipeline 
IDataCursor pipelineCursor = pipeline.getCursor(); 
IDataUtil.put( pipelineCursor, "user", user ); 
pipelineCursor.destroy();

Your output will be a Record named user that has the following structure:

Record - user 
  T - name 
  T - pass 
  T - passHash 
  Record - members 
    [all ACLs to which this user belongs] 
  T - enabled

Hopefully, this will help you get what you need.

Hi
thanks very much, but I still cann’t get correct result…
ours server is webMethods server v3.5

InvokeState.getCurrentState().getProtocolInfoIf().getProtocolProperty(“transport”);
return null

I can get client IP use following code:

is.getCurrentSocket().getInetAddress();

thanks