NVP and SOAP Questions Differences and Terminology

I work a lot with third-party web services. The first thing I am looking for is that they provide WSDL, which I can easily add to Visual Studio, and immediately start using the automatically generated proxy class that VS creates based on WSDL, and obviously I can quickly start coding and start using any 3rd party API.

For example, PayPal offers 2 options for their API. One through a pair of name values ​​and the other SOAP that provides the WSDL, which I can use in my .NET projects, and I'm leaving.

So, can I suggest the following regarding terminology?

  • NVP does not provide WSDL (it is performed using pairs of request name values ​​passed to HTTPRequest)
  • SOAP Web Services may or may not provide WSDL at any time for inclusion in your projects to consume
  • REST is simply an invention that can be applied to the NVP-SOAP / WSDL APIs.
  • Is this called an API or SDK? I always refer to the service I call and call the API calls in the "API", but for some reason my boss calls it the SDK, which does not make sense to me ... the API is what I see most there

I'm not quite sure that my statements are 100% correct and you need to clear this.

+4
source share
2 answers
  • NVP does not provide WSDL (it is performed using pairs of request name values ​​passed to HTTPRequest)

What PayPal calls, called Value-Pair, is not standard. However, they are not the only ones who use it (it seems). This is basically sending parameters in the form of pairs of names and values ​​(obviously), which are very easy to process programmatically, because HTML forms do the same, therefore, by sending NVP, you simulate a web form, and server-side programming is the same.

In short, it's easier to call it NVP than to say: use application/x-www-form-urlencoded .

  1. SOAP Web Services may or may not provide WSDL at any time for inclusion in your projects to consume

In theory, yes. SOAP as a protocol does not provide the use of WSDL for definition / description. It describes only messages between clients and servers (and / or intermediaries). Realistically, however, the concept of SOAP web services usually means web services that are described using WSDL and that use SOAP for messaging. Almost all available programs (.Net, Java, and others, such as gSOAP C / C ++) define web services through WSDL. Tools are available for converting predefined classes to WSDL and vice versa, SOAP is usually handled by library support.

In short, the way to use web services by creating classes from WSDL is standard. Although SOAP defines messaging if there is no service definition - in WSDL it is not a web service because there is no service contract.

  1. REST is simply an invention that can be applied to the NVP-SOAP / WSDL APIs.

REST is certainly not a naming convention, it is an architectural style built largely around the concept of resources and hyperlinks to them. There are good explanations, but you can pretty much identify them by style: you use a small set of verbs (usually HTTP: GET, POST, PUT, DELETE or part of them) to achieve the necessary actions on the resources. Easy way to identify them:

  • Addresses denote resources, so instead of sending actions such as Sale, Authorization and Order as part of the request, you will process different addresses similar to http://www.example.org/Sales/sale-015 and http: // www .example.org / orders / 1337 , with which you can access using GET or delete, using DELETE or change using PUT or POST, if necessary.

  • REST responses usually contain relevant links that you can use for potential follow-up. Thus, the response message for Sale may contain links that allow you to confirm the sale.

REST gives the client and server greater latitude in modification if it is executed correctly. In contrast, SOAP web service clients and servers must adhere to the WSDL contract defined for interoperability.

  1. Is this called an API or SDK? I always refer to the service I call and call the API calls in the "API", but for some reason my boss calls it the SDK, which does not make sense to me ... the API is what I see most there

An API (Application Programming Interface) is a defined list of functions that are accessible externally and defines an interface. An SDK (software development kit) is a group of software tools and libraries that you will use to develop software. Therefore, if you download executable SDK code; if this is documentation that is an API.

Paypal provides an API. In contrast, in order to develop software for the iPhone (just to select an example), you will need to download the Apple iPhone SDK.

+8
source

All SOAP web services must provide WSDL. They do not need to provide it online through the URL. Your web service provider may send you the WSDL by email or other channel. The important thing is that there must be WSDL to describe the service.

"NVP" is what PayPal uses, and possibly a few others. This is not some kind of standard.

REST is a separate architectural style. See SOAP or REST .

+1
source

Source: https://habr.com/ru/post/1314996/


All Articles