用于基于JSON的Web服务的Java框架

时间:2022-12-12 11:22:04

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.

我正在编写基于JSON的Web服务。该服务将接受两种类型的请求:命令(例如createOrder)和查询(例如getOrders)。每个请求都需要发送用户凭据(用户名/密码)进行身份验证(可能在HTTP头中)。该服务需要用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.

您会为此用例推荐哪些框架?我正在考虑的非常基本的堆栈是由像Jackson这样的JSON框架支持的servlet。它们是您推荐的其他框架吗?为什么?没有必要或希望使服务RESTful,但是与Java EE 6或Spring的顺利集成将是一个优势。

Thanks in advance for your time.

在此先感谢您的时间。

5 个解决方案

#1


2  

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.

我可以感兴趣的是RESTful Web Services(这是一个JAX-RS API)吗?实现JAX-RS的库是Jersey,Apache CXF,它适合允许JSON Web服务。

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

一个相关的* Post,显示符合JAX-RS的REST客户端。

#2


1  

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

你应该看看spring mvc并阅读这篇博文,其中介绍了使用spring mvc for restful WS。

#3


1  

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.

玩!框架肯定适合您的账单。它不是基于servlet的,但满足您的所有要求。使用Play的开发速度非常快,您可以立即启动并运行原型。

#4


1  

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!

我个人使用Apache CXF,JAX-RS和jackson库。它们易于实现,并且易于集成。 JAX-RS是一个java标准,Jackson库很快并且处理循环引用,而Apache CXF只需要几行配置来设置和开始运行。去吧!

#5


0  

An Open-Source Services Framework From Apache

来自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.

-CXF旨在提供一种可插拔的体系结构,它不仅支持XML,还支持非XML类型的绑定,例如JSON和CORBA,以及任何类型的传输。

-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

-Java EE集成:在Java EE应用服务器中部署服务,例如Apache Geronimo,JOnAS,Redhat JBoss,OC4J,Oracle WebLogic和IBM WebSphere -Standalone Java客户端/服务器

#1


2  

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.

我可以感兴趣的是RESTful Web Services(这是一个JAX-RS API)吗?实现JAX-RS的库是Jersey,Apache CXF,它适合允许JSON Web服务。

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

一个相关的* Post,显示符合JAX-RS的REST客户端。

#2


1  

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

你应该看看spring mvc并阅读这篇博文,其中介绍了使用spring mvc for restful WS。

#3


1  

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.

玩!框架肯定适合您的账单。它不是基于servlet的,但满足您的所有要求。使用Play的开发速度非常快,您可以立即启动并运行原型。

#4


1  

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!

我个人使用Apache CXF,JAX-RS和jackson库。它们易于实现,并且易于集成。 JAX-RS是一个java标准,Jackson库很快并且处理循环引用,而Apache CXF只需要几行配置来设置和开始运行。去吧!

#5


0  

An Open-Source Services Framework From Apache

来自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.

-CXF旨在提供一种可插拔的体系结构,它不仅支持XML,还支持非XML类型的绑定,例如JSON和CORBA,以及任何类型的传输。

-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

-Java EE集成:在Java EE应用服务器中部署服务,例如Apache Geronimo,JOnAS,Redhat JBoss,OC4J,Oracle WebLogic和IBM WebSphere -Standalone Java客户端/服务器