how web services work.
*this is a guide that was created from lecture videos and is used to help you gain an understanding of what is web services architecture.
What is a Web Service
archive.org/web/web.php to see the waybackmachine, which shows websites over time
What is an API?
Defines everything you need to communicate with a web service.
Elements of a web service API
Message Format- SOAP, XML, JSON
Request Syntax- Named methods, Uniform Resource Identifier, Parameter names and data types
Requesting an action- Named methods, HTTP verbs (POST, GET, PUT, PATCH, DELETE)
Authentication- username and password, authentication tokens
Receiving the data- Formats: SOAP, XML, JSON; Metadata: describes data structure, including field/property names, and data types; Content: the actual data
To get a better understanding of what is web services architecture, visit tutorialspoint
Web Service Predecessors
EDI- Electronic Data Interchange, Documented in 1996 but non standardized in early 1990’s. Computer to computer communications, primarily used for large scale ecommerce
RPC- Remote Procedure Call, back to 1980’s, described in ARPANET docs, clients to call procedures on a remote server, developed in Unix, Microsoft copied with MSRPC
MSRPC- Based on RPC, added unicode strings, inheritance and other new features, DCOM is another Microsoft technology
CORBA- released in 1991, user interface definition language to describe interface to clients. Mapping available for many languages, including Ada, C, C++, Lisp, Ruby, Smalltalk, Java, COBOL, PL/I, Python. Very complex, Java Remote Method Invocation created with other 3rd party attempts.
XML- created in 1998, derived from SGML. Simplicity, REadability, Generality. Plain text and easy to read. Strict formatting rules and good for data exchange and web service messages. Atom and RSS are XML languages.
SOAP- XML -based message format, revolutionized web services, based on XML-RPC but more powerful
Web Service Transport Protocols
Pre-web service transport protocols- telex, telnet, bi-directional modems
Non-HTTP transport Protocols
FTP- well suited for long documents, used for file sharing but can work with asynchronous web services
SMTP(used to send)/POP(used to retrieve)- document storage is on a central hub server
HTTP- text based vocabulary defining requests and responses, document storage usually on the web service provider, support synchronous request/response conversations, listens for requests and provides immediate response
HTTP request syntax
Each request has a method or a verb- HTTP verbs: GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS, CONNECT, PATCH. GET- get data, POST-add data, PUT-update AND DELETE- delete data are most popular.
Not all web services are sensitive to HTTP verbs, check the documentation
GET requests- include query parameters in the URI
To learn more about HTTP requests, go to W3
Web Service Message Formats
Rest console chrome extension used to test web services
Geocoding- process of looking up a location by it’s name,
SOAP is just another form of XML, it needs dedicated libraries on client and server
Other message formats-
AMF: binary format, smaller than most text based formats, created for Flash Player 6, supported by adobe but is open source and freely available. Faster than XML but is not human readable.
Test Formats- HTML, comma/tab-separated files, arbitrary formats requiring custom parsers
Binary formats- spreadsheets, zipped databases, images
Web service standards: SOAP, REST, OData
SOAP- foundation of WS standards, championed by Microsoft, managed by W3C since 2001, SOAP is the format, tools are the key. Understanding SOAP is crucial when asking what is web services architecture.
SOAP for Web Services
RESTful web services- Coined by roy fielding, based on simple HTTP requests and responses, lighter weight than SOAP, Rest is an architecture and not a format. Each request has a verb: GET, POST, PUT, DELETE, can be used with many message formats unlike SOAP which uses only XML. Can use XML variants such as ATOM, RSS or POX or the smaller and faster message format JSON. Restful is stateless and is cacheable which reduces transactions. Popular option for mobile development over SOAP.
OData- a RESTful Standard
Based on REST architecture, fixed message syntax, send through URI’s, choose between XML and JSON, easier to code, response messages will being in ATOM
Other Web Services
XML-RPC: XML Remote Procedure Call
UDDI- universal discovery and description
WSDL- web service description language
WSDM- web services distributed management
WS* Standards from Web Services Interoperability Organization
Discovering useful web services
UDDI: Universal Description Discovery and Integration, developed in 2000 as part of WS-I, designed around SOAP based web services, public registries created by Microsoft, SAP, IBM, XML language to describe a service for registries, not used much on public web
mashup- an integration of a web service API with other capabilities.
What is SOAP
XML based language, developed for Microsoft in late 1990’s, managed by W3C
Extensibility: can be adapted to any business process
Neutrality: Usually used with HTTP but is compatible with asynchronous protocols such as FTP and SMTP
Independence: no lock in to a certain vendor or language
SOAP versions- 1.1 released in 2000 and 1.2 released in 2007 which has clearer processing and better web integration
Messages are sent with ‘Envelopes’
SOAP takes more time and bandwidth.
Header is optional but Body is required.
Understanding SOAP data types
SOAP attempts to be flexible and can represent whatever available through WSDL or Web Services Description Language
Need more information on REST or SOAP? Visit techtarget or feel free to reach out in the comments.