Let's say that I have an XML and it's a request to a service. How can I tell if it's a RESTful service or SOAP service request?
What are the distinguishable characteristics that could be find, based only on request content?
Let's say that I have an XML and it's a request to a service. How can I tell if it's a RESTful service or SOAP service request?
What are the distinguishable characteristics that could be find, based only on request content?
Here's an example of a SOAP request, this is an example of a call to the get cities by country API on http://www.webservicex.net/New/Home/ServiceDetail/56:
POST /globalweather.asmx HTTP/1.1
Host: www.webservicex.net
User-Agent: curl/7.45.0
Accept: */*
Content-Type: text/xml
Content-Length: 442
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:tns="http://www.webserviceX.NET">
<soap:Body>
<GetCitiesByCountry xmlns="http://www.webserviceX.NET">
<CountryName>France</CountryName>
</GetCitiesByCountry>
</soap:Body>
</soap:Envelope>
You can see the distinguishing characteristics of the XML body.
A REST call to a generic service could contain any XML data the API defines.
This might look like:
POST /getaddress HTTP/1.1
Host: localhost:3000
User-Agent: curl/7.45.0
Accept: */*
Content-Length: 85
Content-Type: text/xml
<location>
<latitude>34.067225</latitude>
<longitude>-118.474307</longitude>
</location>