将EJB转换为JSON Web服务 [英] Turn EJB into JSON web service
问题描述
我已经将EJB 3.1转换为Web服务.现在,我需要创建用于与JavaScript组件通信的JSON Web服务. JavaScri [t组件将使用接口的JSON版本与系统进行通信并获取所需的数据.由于性能原因,我不能使用XML而不是JSON.我自己尝试进行研究,但未找到任何解决方案.
I have turn EJB 3.1 into web-service. And now I need to create the JSON webservice for communication with JavaScript component. JavaScri[t component will use JSON version of the interface to communicate with the system and fetch the data needed. I can not use XML instead of JSON by the performance reason. I tried research myself but any solution was not found.
请问您有什么想法,解决方案或链接,如何将EJB和JSON一起使用.
Please, have you any ideas, solutions or links how I can use EJB and JSON together.
谢谢! 最好的祝福 阿尔特姆(Artem)
Thanks! Best regards Artem
推荐答案
是的, JAX-RS 就是为了做到这一点-让您公开RESTful服务.流行的实现是 RestEasy 和泽西.然后,他们将委托给 Jackson 之类的JSON处理器.
Yes, JAX-RS is meant to do that - to let you expose RESTful services. Popular implementations are RestEasy and Jersey. They will in turn delegate to a JSON processor like Jackson.
您可以单独使用Jackson,但是您必须手动管理许多事情.如果您想将SOAP与JSON结合使用(这不是常见选择),请检查JAX-WS和
You can use Jackson alone, but you'll have to manage many things manually. If you want to use SOAP with JSON (which is not the common choice), then check JAX-WS and the JSON Extension
这篇关于将EJB转换为JSON Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!