From the course: Programming Foundations: APIs and Web Services

Web services overview

From the course: Programming Foundations: APIs and Web Services

Start my 1-month free trial

Web services overview

- A web service allows different systems to talk to each other over the internet. These systems can be any combination of devices or applications. It can be a Windows or Linux server, mainframe computer, your desktop computer, or smart phone. All these systems can share data through web services. So, how does it work, exactly? With web services, you'll often hear about interactions between a client and a server. The client sends a message and waits for a response from the server. The server receives the message, and the web service performs an action. Then, a message is sent back to the client. Let's look at it in a different way, say you are in a coffee shop and you want to buy a cup of coffee. But here's the catch. You're in a different country, say, Belgium, and don't speak the language. How are you going to communicate and get what you want? Well, you need help from someone who is able to translate what you want and to get your coffee. So, you turn to your friend who happens to speak both English and French. You're able to communicate to your friend in English. Hey Dennis, can you please get me a chai tea latte? - Sure. - And he can order your coffee in French. (Dennis speaking foreign language) And then bring you your coffee. Thank you, Dennis. In this scenario, you are the client sending a message in a language that your friend, the web service, can understand. The web service is able to communicate with the server and get the task completed. Data is transferred between client and server with a common web language, like XML. Each application can be written in two completely different languages, like .NET or Java, but they can use XML to communicate the data they need. There are two main types of web services, SOAP and RESTful. Both of these require certain components to work. Simple Object Access Protocol, or SOAP, sends messages using XML. An XML document is sent with the data in a certain format. Representational State Transfer, or REST, uses a web protocol, HTTP, to access resources like documents, pictures, or videos. I discuss each of these in more detail in this course and will show you examples and demos so we can create our own web service.

Contents