Chapter 6 - Introduction to Web Services and HTTP

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/40

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

41 Terms

1
New cards

What is HTTP?

HyperText Transfer Protocol.

the fundamental protocol used for communication on the web.

Used to transmit web traffic, including REST and (often) SOAP web services

2
New cards

What is the only required header in an HTTP request?

Host – identifies the domain being accessed.

3
New cards

What does an HTTP response start with?

A line like HTTP/1.0 200 OK, indicating protocol version and status code.

4
New cards

What status codes start with 1?

Informational – e.g., 101 (WebSocket handshake).

5
New cards

What does a status code beginning with 2 mean?

Success – e.g., 200 (OK), 201 (Created), 204 (No Content).

6
New cards

What does a status code beginning with 4 mean?

Client error – e.g., 404 (Not Found), 401 (Unauthorized).

7
New cards

What does a status code beginning with 5 mean?

Server error – e.g., 502 (Bad Gateway).

8
New cards

What do HTTP headers do?

Provide metadata or instructions (e.g., content type, accepted formats).

9
New cards

Can you define custom headers in HTTP?

Yes, it's often used for sending parameters or metadata.

10
New cards

What are name-value pairs used for in HTTP?

A way to pass form data or parameters, e.g. username=alice&password=123.

11
New cards

Where are name-value pairs included in requests?

In the query string (GET) or body (POST).

12
New cards

What does SOAP use to encode data and messages?

XML – a text-based markup language used to encode method calls and responses.

13
New cards

What transport protocols can SOAP use?

Typically HTTP, but also FTP, SFTP, or even hypothetical ones like carrier pigeons.

14
New cards

Why was SOAP developed?

To replace RMI/CORBA with something that worked better with network security and firewalls, using standard protocols.

15
New cards

What is XML-RPC?

A simple XML-based protocol for making remote procedure calls – SOAP evolved from it.

16
New cards

What's the difference between a remote procedure call and a method call?

A procedure uses only parameters passed in;

a method may also use internal object state.

17
New cards

Why does SOAP avoid communication issues?

Because it sends standard XML traffic over standard protocols (like HTTP), which networks already accept.

18
New cards

Why is SOAP considered more secure than RMI?

It does not send executable code, avoiding risks from running unknown or malicious stubs.

19
New cards

How does SOAP support version tolerance?

Unlike RMI, it is less sensitive to software version mismatches, since it relies on structured data, not compiled code.

20
New cards

What are the main drawbacks of SOAP?

  1. Less efficient – XML is large and computationally expensive

  2. Limited flexibility – can't send executable code

  3. One-way communication – servers can’t initiate contact with clients

21
New cards

Why is SOAP considered "less clever" than RMI?

Because it can’t perform dynamic code execution – but this also makes it simpler and safer.

22
New cards

What was the big shift that SOAP represented?

Moving from code-based object invocation (like RMI) to data-based communication using XML and HTTP.

23
New cards

What is REST?

Representational State Transfer.

simpler more modern alternative to soap.

24
New cards

What does REST always use as a transport protocol?

HTTP – unlike SOAP, which can use HTTP, FTP, etc.

25
New cards

What is a RESTful Web Service?

A service where the operation and parameters are encoded directly into the HTTP request.

26
New cards

What response formats can REST return?

Almost anything – usually plain text, XML, or JSON (machine-readable).

27
New cards

What is JSON?

JavaScript Object Notation – a lightweight, readable format for structured data.

28
New cards

What does HATEOAS stand for?

Hypermedia As The Engine Of Application State

29
New cards

What did original REST (with HATEOAS) require?

That clients navigate the service using hypermedia links returned in HTML responses, with no prior knowledge of endpoints.

30
New cards

Do most modern "REST" APIs follow strict HATEOAS rules?

No – most modern REST APIs use a more relaxed definition (URLs + JSON/XML responses).

31
New cards

Why don't most REST APIs use strict HATEOAS?

It's hard to implement, and JSON didn’t exist when REST was first defined.

32
New cards

Can SOAP use transport protocols other than HTTP?

Yes – SOAP can also use FTP, SFTP, or others.

33
New cards

Where are method calls and parameters encoded in REST?

In the URL itself, not in a separate message body.

34
New cards

Can REST separate headers from requests?

No – in REST, the header is the request.

35
New cards

What format is most common in this module for REST responses?

JSON – for structured data.

36
New cards

What’s the main structural difference between SOAP and REST requests?

  • SOAP: Method + parameters in an XML body (separate from header)

  • REST: Method + parameters in the URL and HTTP method

37
New cards

Can SOAP work if firewalls block non-standard traffic?

Yes, but it may require configuration. REST has fewer issues as it uses standard HTTP.

38
New cards

Which is more lightweight – SOAP or REST?

REST – fewer headers, simpler format, smaller messages.

39
New cards

In SOAP, what does the Content-Type header usually say?

text/xml or application/soap+xml

40
New cards

Which is better for simple web APIs – SOAP or REST?

REST, due to its simplicity, standard usage, and lightweight design.

41
New cards

What is the only thing passed between machines in both SOAP and REST?

Data – including method names, parameters, and results.
(No code is transferred.)