简体   繁体   English

Soap vs Rest over Android

[英]Soap vs Rest over Android

I am creating an app in android. 我在android中创建一个应用程序。 It will be calling a webservice to fetch some confidential info. 它将调用Web服务来获取一些机密信息。 I need to verify that the user is authenticated to access the info and the service shouldn't be called from any other source even if the user has all the required credentails to access the service. 我需要验证用户是否经过身份验证才能访问该信息,并且即使用户具有访问该服务所需的所有凭据,也不应从任何其他源调用该服务。

What should be used to ensure the security.... REST or SOAP? 应该用什么来确保安全...... REST或SOAP?

For security you should use SSL with client authentification and possibility to revoke cvlient certificates (though not every appplication server will support this). 为了安全起见,您应该使用SSL与客户端身份验证以及撤销cvlient证书的可能性(尽管并非每个应用程序服务器都支持此功能)。 SOAP or REST do not have differences in this context. SOAP或REST在此上下文中没有差异。

In my experience REST is easier to build and has less overhead. 根据我的经验,REST更容易构建并且开销更少。 I used to build soap services with CXF, which is really easy, but now I use Restlet for the server, which is even easier and quicker. 我曾经使用CXF构建soap服务,这非常简单,但现在我使用Restlet作为服务器,这更容易和更快。 Restlet has integration for Json, Guice, JPA, and all the good stuff. Restlet集成了Json,Guice,JPA和所有好东西。 At the Android side, I use a simple rest interface with httpClient, Roboguice and Jackson. 在Android方面,我使用了一个简单的休息界面,httpClient,Roboguice和Jackson。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM