TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: SOAP or RESTful

1 点作者 thatusertwo超过 12 年前
I'm working with a client, I've been asked to develop an Android App and an iPhone App. The app requires access to an online database so it needs a Web Service.<p>The client requires that the web service be developed on a .NET 4.0 server with VB.<p>I've found examples online of both methods, although RESTFul seems to be a little more hacky.<p>What way should I go?

1 comment

davismwfl超过 12 年前
Not sure I understand why you say RESTful is more hacky, but I have recently done exactly the same type of project. Except we used C#.<p>There are a lot of reasons we went RESTful but some are:<p>1) XML parsing is very CPU intensive for mobile devices and can quickly drain battery life.<p>2) Payload of SOAP is much larger than JSON, meaning that you are tying up resources and network bandwidth for mobile devices.<p>3) RESTful intent is easy to understand, POST/GET/PUT etc. Especially if you are interacting with a DB.<p>4) Coding was simple in both the .NET and the mobile side, at least in comparison of dealing with XML all the time.<p>5) Performance is generally better, again most of this is thanks to the payload size.<p>6) Using RESTful allowed us to also reuse the same API's on the website and consume them in JavaScript natively. No extra layers of translation or craziness involved.<p>Not saying XML doesn't have its uses, but I would not use SOAP again unless forced to interact with a system that required it. I hate bloat, and performance is eaten in CPU cycles wasted on parsing bloat when it comes to SOAP.<p>I should note, nothing about RESTful says you have to use JSON, you could return XML payloads. To me returning XML for this type of usage is just a bad idea most of the time.
评论 #4734605 未加载
评论 #4734598 未加载