贝宝 SOAP 和 NVP
我是 PayPal 的新手,我想知道实施 PayPal、SOAP 或 NVP API 哪种方法更好。
这两者之间的主要区别是什么???
I am new to PayPal and i want to know which is batter way to implement PayPal, SOAP or NVP API.
And what is the major difference between these two???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我建议使用 NVP(名称-值对,基本上是带有数据的 POST)API 而不是 SOAP API。 NVP 的重量应该比 SOAP 轻得多。已有一些问题关于 投诉 SOAP。我只是想弄清楚该使用哪个,然后发现了这些。希望有帮助。
另外,PayPal 是如何描述 NVP API 的:
强调我自己的。
I would recommend using the NVP (Name-value pair, basically POST with data) API over the SOAP API. NVP should be significantly lighter weight than SOAP. There are a few questions already on SO that complain about SOAP. I just was trying to figure out which to use and came upon those. Hope that helps.
Also, here's how PayPal describes the NVP API:
Emphasis my own.
最好使用 PayPal SOAP API(因为我已经完全实现了这个)。 donut 说 NVP 是轻量级的,这是正确的。但使用 SOAP 有两个主要优点:
我建议使用 SOAP 而不是 NVP,但这也取决于使用情况。
It's better to use the PayPal SOAP API (as i have completely implemented this). donut is correct in saying that NVP is lightweight. But there are 2 main advantages of using SOAP:
I recommend SOAP over NVP, but it also depends upon usage.
我只是认为 SOAP 对于很多新程序员来说更好,他们会更适应它,因为它是面向对象的。但是当你没有自己创建对象时,很难找到并理解 API 中的逻辑!
NVP 是结构化的,因此您可以在脚本中创建自己的对象。这个版本的可扩展性越来越强!
I simply think that SOAP is better for a lot of new programmers, who will be more confortable with it cause it s object oriented. But it is quite difficult to find and understand a logic in APIs when you did not create the objects by yourself in it !
NVP is structural so you can create your own objects in your scripts. This version is by more and more extensible !!!
NVP(名称值对)通常称为 REST(表述性状态传输)协议,您可以通过 HTTP 发送名称值对,其方式与 HTML 表单向服务器发送信息的方式类似。我更喜欢 NVP/REST,因为它遵循 KISS 原则(先生,保持简单),即简单的系统比更复杂的系统更容易构建,并且需要更少的时间和精力来维护。这就是为什么在大多数情况下我会推荐 REST (NVP) 而不是 SOAP。
然而,在您需要更高的安全性和/或与现有软件包或库集成的情况下,根据具体情况,SOAP 可能是合适的解决方案。
NVP (Name-Value-Pair) is commonly referred to as REST (REpresentational State Transfer) protocol where you send name value pairs over HTTP in a similar manner to how an HTML form sends information to a server. I prefer NVP/REST since it follows the KISS Principle (Keep It Simple Sir) which is the philosophy that simple systems are easier to build and require less time and effort to maintain than more complicated systems. This is why in most situations I would recommend REST (NVP) over SOAP.
However, in situations where you require more security and/or are integrating with an existing software package or library, SOAP might be an appropriate solution depending on the circumstance.