IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

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.



#Automation


#Applicationintegration
#webMethods
#Integration
 View Only
  • 1.  Determining if a client is connected

    Posted 07/16/02 07:18 PM

    I am trying to find a way to determine if a particular client is connected or not using the Java API’s. Using the getClientInfoById doesn’t seem to report information on the clients session. Anyone have any experience with doing this?


    #webMethods
    #Integration-Server-and-ESB


  • 2.  RE: Determining if a client is connected

    Posted 07/16/02 08:30 PM

    getClientInfoById returns a BrokerClientId object. The public var named “sessions” is an array of BrokerClientSession objects. The BrokerClientSession objects contain all the session info that you can see with Manager. If the array is empty, the client isn’t connected.


    #Integration-Server-and-ESB
    #webMethods


  • 3.  RE: Determining if a client is connected

    Posted 07/16/02 08:32 PM

    Of course by “BrokerClientId” object I meant “BrokerClientInfo” object. Darn fingers just don’t work sometimes…


    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Determining if a client is connected

    Posted 07/16/02 09:48 PM

    Roughly coded example follows:

    import COM.activesw.API.client.BrokerAdminClient;
    import COM.activesw.API.client.BrokerClientInfo;

    public class ClientConnectionTest extends Object {

    public static void main(String arguments) {
    try {
    BrokerAdminClient bac = new BrokerAdminClient(
    “localhost”,“Broker #1”,“admin1”,“admin”,“admin1”,null);
    String clients = bac.getClientIds();
    for (int index = 0; index < clients.length; index++) {
    BrokerClientInfo info = bac.getClientInfoById(clients[index]);
    System.out.println(“client " + clients[index] + " has " +
    info.sessions.length + " active sessions”);
    if (info.sessions.length == 0) {
    System.out.println(clients[index] + " is not connected");
    }
    if (info.sessions.length != 0) {
    System.out.println(clients[index] + " is connected");
    }
    }
    } catch (Exception e) { e.printStackTrace(); }
    }

    }


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: Determining if a client is connected

    Posted 02/26/03 08:04 PM

    Hi
    I Try the incorporate the code, but show me the below error:
    (059) Could not process request document of type “TEST::TryCatchEvent::In_TryCatch_Test”
    (109) Run-time exception while processing “Bservicios_Client_Connected”
    java.security.AccessControlException: access denied (java.net.SocketPermission

    what is happened?

    thanks


    #Integration-Server-and-ESB
    #webMethods