3 Replies Latest reply on Jan 27, 2004 3:14 PM by DRAI William

    SOAP connector example

    gjb Newbie

       

      "gjb9876" wrote:
      "gjb9876" wrote:
      Hello. First I would like to appologize for giving up on searching for the answers to my very simple questions...

      I'm running JBoss-3.2.1 and have several MBeans deployed.

      I want to write a simple java application (separate JVM, perhaps running on a separate machine than my server). And I want to connect to my MBeans. I'm under the impression that the SOAP connector will do what I need. (so far I've used HTML to talk with the HTMLAdapter but oh yuck I don't want to do much testing this way, would be much better to have the java objects themselves).

      I've purchased the book, JMX by Juha and Marc, who I've seen answer several postings on this forum... but still I have a few questions...

      1. where can I download the source to the examples in the book? Book is two years old already, and I don't think they are included with Sun's RI anymore, are they? Please provide current URL to download from.

      2. Do I still need to use GLUE to use SOAP? (I'm very new to SOAP, but assume it won't take long to figure out the hello world to communicate with my MBeans). GLUE is no longer free, only free evaluation.

      3. Does anyone have a very simple java client application that uses SOAP to connect to an MBean running within JBoss-3.2.1? I'd love to have something to get me started...

      4. Is there any reason I should use RMI instead of SOAP? (RMI is old-fashioned, isn't it?)

      OK, that should do it :)
      Thanks, Gretel


        • 1. Re: SOAP connector example
          DRAI William Newbie

           

          "wdrai" wrote:
          "wdrai" wrote:
          You should better use the RMI Connector. It works well and it is very easy to use.
          I can see absolutely no reason to use SOAP to call MBeans from a Java client.

          You can do something like :
          InitialContext ctx = new InitialContext();
          RMIAdaptor server = (RMIAdaptor) ctx.lookup("jmx/rmi/RMIAdaptor");
          ObjectName name = new ObjectName("my:name=myMbean");
          Object[] params = { myParam };
          String[] signature = { "java.lang.String" };
          Object result = server.invoke(name, "myMethod", params, signature);


          • 2. Re: SOAP connector example
            gjb Newbie

             

            "gjb9876" wrote:
            "gjb9876" wrote:
            Thanks for the info about the simple RMI example. This looks like you must run client on the same machine as the server? Or... where do I specify the server IP and port?

            Also, I'm still interested in a SOAP connector example, can anyone else help me out with more info?

            Thanks, Gretel


            • 3. Re: SOAP connector example
              DRAI William Newbie

               

              "wdrai" wrote:
              For RMI just put in your client classpath a jndi.properties file containing :

              java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
              java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces
              java.naming.provider.url=jnp://somehost:1099