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.  Get Session Client IP Address

    Posted Tue January 15, 2008 04:34 AM

    Long story short: Is there some way to get the client’s IP address when they send a file via FTP? (It’s not accessed by getTransportInfo… that only works for HTTP) It shows up in the Integration Server logs, so it is obviously being saved somewhere. Currently, our flow starts by a pub.client.ftp:putCompletedNotification trigger, but we are open to using flow invocation if that will allow us to access the IP through pub.flow:getSession. While getSession gives the session ID, I cannot figure out how to get the client’s IP… has anyone here attempted to do this?


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Get Session Client IP Address

    Posted Tue January 15, 2008 03:41 PM

    Have you tried getTransportInfo when invoking a service directly via FTP instead of via the notification trigger?


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 3.  RE: Get Session Client IP Address

    Posted Tue January 15, 2008 05:53 PM

    getTransportInfo only provides filename and mimetype for FTP invocations…


    #Integration-Server-and-ESB
    #webMethods
    #webmethods-Protocol-and-Transport


  • 4.  RE: Get Session Client IP Address

    Posted Tue January 15, 2008 06:09 PM

    Ah, yes, that’s right.

    My only thought is to find a non-public method in ServerAPI or maybe in the Session class.


    #webMethods
    #Integration-Server-and-ESB
    #webmethods-Protocol-and-Transport


  • 5.  RE: Get Session Client IP Address

    Posted Tue January 15, 2008 06:34 PM

    This might work for you. A Java service named getClientIP.

    try
    {
    InvokeState is = new InvokeState();
    IDataUtil.put(pipelineCursor, “clientIP”, is.getCurrentSocket().getInetAddress().toString());
    }
    catch (Exception ex)
    {
    IDataUtil.put(pipelineCursor, “clientIP”, “INTERNAL”);
    }


    #webmethods-Protocol-and-Transport
    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: Get Session Client IP Address

    Posted Tue January 15, 2008 08:57 PM

    Thanks for the reply! Your code worked nicely and for future reference here is another way I found to get the same data:

    // pipeline

    Session sessionObject = Service.getSession();
    String clientIp = sessionObject.getName();

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    IDataUtil.put( pipelineCursor, “clientIp”, clientIp );
    pipelineCursor.destroy();


    #webMethods
    #webmethods-Protocol-and-Transport
    #Integration-Server-and-ESB