Naresh
Naresh

Reputation: 25793

Java framework to use for JSON based web service

I am in the process of writing a JSON based web service. The service will accept two types of requests: commands (e.g. createOrder) and queries (e.g. getOrders). Each request needs to send user credentials (username/password) for authentication (perhaps in HTTP headers). The service needs to be implemented in Java.

Which frameworks would you recommend for this use case? The very basic stack that I am thinking of is servlets backed by a JSON framework like Jackson. Are they any other frameworks that you would recommend and why? There is no need or desire to make the service RESTful, however smooth integration with Java EE 6 or Spring would be a plus.

Thanks in advance for your time.

Upvotes: 5

Views: 6764

Answers (5)

Varun Achar
Varun Achar

Reputation: 15109

I personally use Apache CXF, with JAX-RS and jackson libraries. They are easy to implement and integration is dead easy. JAX-RS is a java standard, Jackson library is fast and handles circular references and Apache CXF needs only a couple of lines of configuration to setup and start running. Go for it!

Upvotes: 1

gokhansari
gokhansari

Reputation: 2439

An Open-Source Services Framework From Apache

-CXF has been designed to provide a pluggable architecture that supports not only XML but also non-XML type bindings, such as JSON and CORBA, in combination with any type of transport.

-Java EE integration: deploy services in Java EE application servers such as Apache Geronimo, JOnAS, Redhat JBoss, OC4J, Oracle WebLogic, and IBM WebSphere -Standalone Java client/server

Upvotes: 0

Tommi
Tommi

Reputation: 8608

Play! Framework would definitely fit your bill. It is not servlet-based but fulfills all of your requirements. Plus development with Play is very fast, you can get a prototype up and running in no time.

Upvotes: 1

Buhake Sindi
Buhake Sindi

Reputation: 89169

Can I then interest you in RESTful Web Services (which is a JAX-RS API)? A library that implements JAX-RS is Jersey, Apache CXF, which is suited to allow JSON Web Service.

A related StackOverflow Post which shows REST clients that conforms to JAX-RS.

Upvotes: 2

user180100
user180100

Reputation:

You should take a look at spring mvc and read this blog post which cover using spring mvc for restful WS.

Upvotes: 1

Related Questions