EJB:
java only, but more functionality such as transactions and java objects are transmitted between JVM.
Web service: should work for inter language communication, xml-rpc comes to mind as a solution between ejbs and key value pairs. Usually, no transaction manager.