Information & Communication
Architecture 2 [BINF 405]
GUC - Spring 2024 – Lecture 3
Distributed Systems using XML,
HTML and HTTP Protocol
Dr. Ayman Al-Serafi
TAs: Ghada Ahmed, Tameem Alghazaly, Youssef Ihab, Mohab Gehad
Outline
1. Running Example: SWIFT Interbank
2. XML Messaging
3. HTML
4. HTTP Protocol Methods for Messaging
5. Conclusion
Q&A breaks
between sections
Urgent Qs only in
between!
ICA II - GUC - Dr. Ayman Alserafi 3-2
Outline
1. Running Example: SWIFT Interbank
2. XML Messaging
3. HTML
4. HTTP Protocol Methods for Messaging
5. Conclusion
ICA II - GUC - Dr. Ayman Alserafi 3-3
S.W.I.F.T. in International Politics
ICA II - GUC - Dr. Ayman Alserafi 3-4
S.W.I.F.T. in International Politics
ICA II - GUC - Dr. Ayman Alserafi 3-6
S.W.I.F.T. in International Politics
Non-Aligned Movement History
S.W.I.F.T.
ICA II - GUC - Dr. Ayman Alserafi 3-7
What is S.W.I.F.T.?
The Society for Worldwide Interbank Financial Telecommunication (SWIFT)
International banking orgranisation for executing global bank transfers and payment transactions since
1973
Headquartered in Belgium and has a consortium of global partner banks investing in it (Shareholders)
Supports International bank transaction settlement and clearance between banks via
intermediate banks or …
In the context of cross-border transactions, this step often takes place through correspondent banking
accounts that financial institutions have with each other.
“the main messaging network through which international payments are initiated”
(source: Wikipedia)
It also sells software and services to financial institutions, mostly for use on its proprietary "SWIFTNet",
and ISO 9362 Business Identifier Codes (BICs), popularly known as "SWIFT codes“
Has its own middleware messaging software, secured TCP/IP network communication, etc.
ICA II - GUC - Dr. Ayman Alserafi 3-8
What is S.W.I.F.T.?
SWIFT handles all intermediary message
authentication, encryption, relaying, auditing, etc…
Replaced traditional Telex messaging (unstructured
text!) Requires human intervention!
SWIFT does not transfer physical cash but rather
facilitates the completion of business transactions
between global banks via machine-to-machine activity
ICA II - GUC - Dr. Ayman Alserafi 3-9
Running Example: S.W.I.F.T.
Interbank Network
SWIFT is an intermediary
organization using middleware
based on XML!
HTTP
XML METHODS
ICA II - GUC - Dr. Ayman Alserafi 3-10
Enterprise Information Integration
(EII)
Data integration was earliest form of integration, but
batch ETL (Extract, Transform, Load) solutions of the
past were not capable of meeting today’s real-time
Option 1
integration (e.g., with RFID)
Enterprise Application Integration (EAI) solved data
latency problem by synchronizing changes across
systems in real time, but
EAI can effectively move data among systems in real
time, but does not define an aggregated view of the data
Option 2 objects or business entities
We focus
on EAI in
this course!
ICA II - GUC - Dr. Ayman Alserafi 3-11
Outline
1. Running Example: SWIFT Interbank
2. XML Messaging
3. HTML
4. HTTP Protocol Methods for Messaging
5. Conclusion
Q&A
ICA II - GUC - Dr. Ayman Alserafi 3-12
Structured Data
Has fixed schema for data: structure of
data elements that all data instances must
follow!
BIC SWIFT
Bank Name City Address Code
NBE Cairo Head Office NBEGEGCX001
CIB Cairo GUC Branch CIBEEGCX048
Banque Misr Cairo Cairo Head Office BMISEGCX101
Alex Bank Alexandria Alexandria Head Office ALEXEGCX001
ICA II - GUC - Dr. Ayman Alserafi 3-13
Unstructured Data
The main branch of the National Bank of
Egypt is located in Cairo and has the code of
NBEGEGCX001
The bank office with the identification number
ALEXEGCX001 is the Bank of Alexandria
with its head-office in downtown Alexandria
…
ICA II - GUC - Dr. Ayman Alserafi 3-14
Semi-structured Data: e.g., XML
Data has specific identified fields
<?xml version="1.0"?>
Fields can have different flexible
<Banks>
hierarchies and embedded <Bank>
information elements or attributes <Name>NBE</Name>
<City>Cairo</City>
<Location>Head Office</Location>
Fields are not restricted as long
<BIC>NBEGEGCX001</BIC>
as the data file is VALID </Bank>
Multiple XML schemas /
structures might be valid for the <Bank name="CIB">
same data! <Location>Cairo</Location>
<SWIFT>CIBEEGCX048</SWIFT>
<Type>Commercial</Type>
Example: eXtensible Markup
Language (XML) </Bank>
... </Banks>
Schema-less nature of document,
although can define schema with a
schema definition language like
XSD
ICA II - GUC - Dr. Ayman Alserafi 3-15
eXtensible Markup Language (XML)
<?xml version="1.0" encoding="UTF-8"?>
ROOT <breakfast_menu>
<food>
<name>Belgian Waffles</name>
Element
<price>$5.95</price>
<description>
Two of our famous Belgian Waffles with plenty of real maple
syrup
</description>
<calories>650</calories>
Open / </food>
<food>
start tag <name>Strawberry Belgian Waffles</name>
<price>$7.95</price>
<description>
Close / end Light Belgian waffles covered with strawberries and whipped
cream
tag </description>
<calories>900</calories> Attribute
</food>
<food calories=“950”>
<name>Homestyle Breakfast</name>
<price>$6.95</price>
<description>
Two eggs, sausage, toast, and our ever-popular hash browns Data
</description>
</food>
</breakfast_menu>
ICA II - GUC - Dr. Ayman Alserafi 3-16
eXtensible Markup Language (XML)
XML Comments: <!- comment here -->
<?xml version="1.0" encoding="UTF-8"?> Prologue
<Products>
<Books>
<Book ISBN="978- 0871139856">
<title>So brave, young and handsome</title>
<author>Leif Enger</author>
<publisher>Atlantic monthly press</publisher>
<language>English</language>
<price>$14.40</price>
<rating>5</rating>
</Book>
</Books> Attribute
Root <Magazines>
Element <Magazine ASIN="B00005N7QG">
<title>Good Housekeeping</title>
<publisher>Hearst magazines</publisher>
<language>English</language>
Nested <price>$10.00</price>
<issues>monthly</issues>
Elements <subscription>1-year subscription</subscription>
<rating>4</rating>
</Magazine>
</Magazines>
</Products>
ICA II - GUC - Dr. Ayman Alserafi 3-17
eXtensible Markup Language (XML)
Used to transport data between machines and
applications, not to manipulate or process data!
Therefore, a markup language (NOT programming
language)
Can be interpreted by humans (readable!) and
machines (has specific defined syntax!)
A global standard by the W3C (World Wide Web
Consortium)
ICA II - GUC - Dr. Ayman Alserafi 3-18
How might an XML message
for S.W.I.F.T. transfers
look like?
ICA II - GUC - Dr. Ayman Alserafi 3-19
How Might an XML message
for S.W.I.F.T. look like?
<BankTransfer>
<SendingBank> S.W.I.F.T. has to
decide on the
<FinInstId> message format
<BIC>CIBEEGCX140</BIC> all banks must
</FinInstId> use
<AccNum>1000789735</AccNum>
<Transfer type="Instant">
<Amount>1000</Amount>
<Currency>EGP</Currency>
</Transfer> S.W.I.F.T. can consult
banks how to implement
</SendingBank>
this or sell them
<ReceivingBank> specialized software that
<FinInstId> creates such kind of
<BIC>DEUTDESS659</BIC> standard messages!
</FinInstId>
<IBAN currency="EUR"> DE20000223123123123002356
</IBAN>
</ReceivingBank>
</BankTransfer>
ICA II - GUC - Dr. Ayman Alserafi 3-20
Outline
1. Running Example: SWIFT Interbank
2. XML Messaging
3. HTML
4. HTTP Protocol Methods for Messaging
5. Conclusion
Q&A
ICA II - GUC - Dr. Ayman Alserafi 3-21
HTML
HyperText Markeup Language
Used to define the structure of webpages on the
Internet
Uses specific predefined XML tags
Any webpage has an HTML formatted document
behind it
The browser parses the HTML document by scanning
it and can interpret what needs to appear for the user.
ICA II - GUC - Dr. Ayman Alserafi 3-22
Visit W3schools.com to learn
in details HTML, XML, and
HTML Example more
Right-click >> View Page Source
ICA II - GUC - Dr. Ayman Alserafi 3-23
HTML Tags
No need to write HTML in this
course but just note it is based on
XML with specific defined tags!
ICA II - GUC - Dr. Ayman Alserafi 3-24
HTML forms are used to send data from the
client to the web server, e.g., to create a new
HTML Tags account or to login by user or to send bank
transfer details! This is sent by HTTP
messages (following section of this lecture!)
ICA II - GUC - Dr. Ayman Alserafi 3-25
HTML Tags
When the submit button is clicked it fires an
HTTP request, sending the content of the form
to the web server to process it and return a
response object (E.g., webpage with success
message or logged-in user homepage)!
ICA II - GUC - Dr. Ayman Alserafi 3-26
Outline
1. Running Example: SWIFT Interbank
2. XML Messaging
3. HTML
4. HTTP Protocol Methods for Messaging
5. Conclusion
Q&A
ICA II - GUC - Dr. Ayman Alserafi 3-27
HTTP Intro
Hypertext Transfer Protocol (HTTP) is the main
application layer communication protocol in
the TCP/IP WWW network stack
Manages the communication messages
between a web client and a web server
HTTP Request
Web
Client Server
HTTP
ICA II - GUC - Dr. Ayman Alserafi Response 3-28
HTTP Overview Example
An HTTP Request identifies the specific
action that needs to be performed on a
given resource specified by a Request
URL
It consists of:
A Method: the desired
action to be performed
on the identified resource
A URI which is a path
(URL) to the requested
resource
The version of HTTP
An optional Header
An optional Body
ICA II - GUC - Dr. Ayman Alserafi 3-29
HTTP Methods Components
Methods: GET,
POST, PUT,
DELETE, etc.
HTTP Request
Web
Client Server
HTTP
Body can include:
Response
HTML, XML,
JSON, etc.
ICA II - GUC - Dr. Ayman Alserafi 3-30
HTTP Request Example
POST /transfer HTTP/1.1
Host: api.bank.com This says that
input data sent
Content-Type: application/x- is data from an
www-form-urlencoded HTML form!
Content-Length: 23
amount=120¤cy=EGP
GET
/transfer?amount=120¤cy=EGP
HTTP/1.1
Host: api.bank.com
Content-Type: application/x-www-
form-urlencoded
ICA II - GUC - Dr. Ayman Alserafi 3-31
GET Vs. POST
GET POST
Cached Can be cached Not cached
application/x-www-form-urlencoded or
application/x-www-form-
Encoding type urlencoded
multipart/form-data. Use multipart
encoding for binary data
Yes, when sending data, the
GET method adds the data to the
Restrictions on data length URL; and the length of a URL is No restrictions
limited (maximum URL length is
2048 characters)
No restrictions. Binary data is also
Restrictions on data type Only ASCII characters allowed
allowed
GET is less secure compared to
POST because data sent is part
POST is a little safer than GET
of the URL
because the parameters are not stored
Security in browser history or in web server
Never use GET when sending
logs
passwords or other sensitive
information!
Data is visible to everyone in the
Visibility URL
Data is not displayed in the URL
Data will be re-submitted (the browser
BACK button/Reload Harmless should alert the user that the data are
about to be re-submitted)
Bookmarked Can be bookmarked Cannot be bookmarked
Parameters remain in browser Parameters are not saved in browser
History history history
ICA II - GUC - Dr. Ayman Alserafi 3-32
HTTP Response Example
HTTP/1.1 200 OK
Date: Mon, 23 May 2021 22:38:34 GMT
Content-Type: application/xml; charset=UTF-8
Content-Length: 241
Last-Modified: Wed, 23 May 2021 23:37:55 GMT
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux)
ETag: "3f80f-1b6-3e1cb03b"
Accept-Ranges: bytes
Connection: close
<BankTransfer state=”successful”>
<Sender>
<BIC> CIBEEGCX048</BIC>
<account>1022131233</account>
<amount currency=”EGP”>1000</amount>
</Sender>
<Receiver>
<BIC> ALEXEGCX001</BIC>
<account>45992388399</account>
</Receiver>
</BankTransfer>
ICA II - GUC - Dr. Ayman Alserafi 3-33
HTTP Response Example
HTTP/1.1 200 OK
Date: Mon, 23 May 2021 22:38:34 GMT
Content-Type: application/xml; charset=UTF-8 This is the HTTP
Content-Length: 241 response message
Last-Modified: Wed, 23 May 2021 23:37:55 GMT header. Describes the
Server: Apache/1.3.3.7 (Unix) (Red-Hat/Linux) content of the message
ETag: "3f80f-1b6-3e1cb03b"
and the type to be XML!
Accept-Ranges: bytes
Connection: close
<BankTransfer state=”successful”>
<Sender>
This is the HTTP
<BIC> CIBEEGCX048</BIC>
response message
<account>1022131233</account>
<amount currency=”EGP”>1000</amount> body. Contains the
</Sender> content of the message,
<Receiver> which is XML in this
<BIC> ALEXEGCX001</BIC> case!
<account>45992388399</account>
</Receiver>
</BankTransfer>
ICA II - GUC - Dr. Ayman Alserafi 3-34
HTTP
Request methods
HTTP request methods indicate the desired
action to be performed on the identified
resource:
GET
Requests a representation of the specified resource.
POST
Submits data to be processed (e.g., from an HTML form) to
the identified resource. The data is included in the body of
the request.
PUT
Uploads a representation of the specified resource.
DELETE
Deletes the specified resource.
ICA II - GUC - Dr. Ayman Alserafi 3-35
Outline
1. Running Example: SWIFT Interbank
2. XML Messaging
3. HTML
4. HTTP Protocol Methods for Messaging
5. Conclusion
Q&A
ICA II - GUC - Dr. Ayman Alserafi 3-36
DISTRIBUTED COMMUNICATION
ARCHITECTURE A standard message
GET or POST?
format!
GET! As data parameters (WEB HTTP protocol)
given in URL!
ICA II - GUC - Dr. Ayman Alserafi 3-37
HTML Tags Default method=“get”, can
change to method=“Post”
ICA II - GUC - Dr. Ayman Alserafi 3-38
S.W.I.F.T.’s Effect
In essence, SWIFT is a messaging interface
(middleware) that uses XML messages and
the TCP-IP protocol (sending XML between
machines using HTTP messages).
Just simple XML messaging communication
systems like SWIFT can affect global politics,
economics and trade!
See how important this course is?!
ICA II - GUC - Dr. Ayman Alserafi 3-39
Date Lecture (Saturdays) Tutorials (in same week)
Week 1 Introduction to Information & Communication Architecture II
Intro + XML Lab
Week 2 Distributed Systems
Web APIs + HTTP Protocols Lab
Week 3 XML Intro + HTML + HTTP Protocol (Intro to VS and Webforms + XML Binding)
HTTP API Methods + Practical for HTTP methods
Week 4 Cloud Computing Assignment 1
Mini-Project 1
HTTP API Methods + Practical for HTTP methods
Week 5 Virtualisation
Quiz 1
Week 6 Middleware Overview and components Cloud Computing Case Study
16 March –
Mid-Term Exam
1 April
Virtualization Case Study
Week 7 Middleware Overview and Components Assignment 1 submission
Mini-Project 1 submission
SOA, Web Services and SOAP
Week 8 The Organizational SOA Roadmap
Assignment 2
Week 9 Registering and Discovering Web Services SOAP + WSDL + UDDI Lab
REST API Lab 1 +JSON
Week 10 REST API Assignment 2 submission
Quiz 2
Middleware Messaging, Enterprise Service Bus, REST API Lab 2
Week 11 Final Project submission
Transaction Processing
Final Course Lab
Middleware Messaging, Enterprise Service Bus,
Week 12 Quiz 3
Transaction Processing
Assignment 2 submission
Week 13 Revision
28 May - 13 June
Final Exam
Course Material
CMS
ICA II - GUC - Dr. Ayman Alserafi 1-41
THANK YOU FOR
YOUR ATTENTION
NEXT WEEK: Cloud Computing
& Virtualisation
NEXT TUTORIAL: XML and
HTTP API Methods