Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Turn EJB into JSON web service

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.

Please, have you any ideas, solutions or links how I can use EJB and JSON together.

Thanks! Best regards Artem

like image 919
Tioma Avatar asked Feb 14 '11 17:02

Tioma


1 Answers

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.

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

like image 81
Bozho Avatar answered Sep 21 '22 19:09

Bozho