webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  How to get client IP address in webMethods service

    Posted Wed October 09, 2002 05:05 AM

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


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 2.  RE: How to get client IP address in webMethods service

    Posted Wed October 09, 2002 03:20 PM

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

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


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 3.  RE: How to get client IP address in webMethods service

    Posted Wed October 09, 2002 04:06 PM

    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.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: How to get client IP address in webMethods service

    Posted Fri October 11, 2002 05:12 AM

    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


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 5.  RE: How to get client IP address in webMethods service

    Posted Fri October 11, 2002 06:08 AM

    I can get client IP use following code:

    is.getCurrentSocket().getInetAddress();

    thanks


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services