Look at the JMS any of the examples. They all use a InitialContext to get connections from the server. IF you can get it running on the same machine the server is on, then all you need to cahnge to get it to run on another machine is the jndi.properties files that is in the clients classpath. the jndi.properties files tells the InitialContext how to connect to the JNDI sever that jboss brings.
Thanks. Will do.